Automatic Field change

  • Thread starter Thread starter SquarePants
  • Start date Start date
S

SquarePants

How do I link the following tables so a change to
1stTable.Purpose is automatically reflected in
2ndTable.Purpose? Relationship is one-to-many.

1stTable: 2ndTable:
(pk) Room pk Chair
Purpose Room
Purpose
 
-----Original Message-----


If you have a unique index on the field Purpose in 1stTable then you can create a
relationship to the Purpose field in 2ndTable and specify Cascade updates in the
definition of the relationship. Otherwise you cannot do this at the table level.
You would have to always apply the edits using a form or function that would include
code to automatically make the same changes in the other table.
Hi Rick, Thanks for the quick reply.
I do have a unique index on 1stTable.Purpose and I have
built the relationship with Cascade Updates to
2ndTable.Purpose. However, when I change the value of a
record in 1stTable.Purpose it does not change the
corresponding values in 2ndTable.Purpose.
 
SquarePants said:
Hi Rick, Thanks for the quick reply.
I do have a unique index on 1stTable.Purpose and I have
built the relationship with Cascade Updates to
2ndTable.Purpose. However, when I change the value of a
record in 1stTable.Purpose it does not change the
corresponding values in 2ndTable.Purpose.

I wasn't sure if it would work if the fields involved in the relationships weren't
the Primary Key in either table, but I just tried this with a couple of sample tables
and it worked fine for me.

I had a field txt1 in Table1 (unique Index, not the PK)
I had a field txt2 in Table2 (no index, not the PK)

I created a relationship with cascade update enforced between the fields. I then
made identical entries in both tables "test". Afterwards, I changed the entry in
Table1 to "test++++" and the entry in Table2 automatically changed.
 
I must be missing a step? I set up the same two tables as
you did, enforced cascade update, set values in both
tables to "test". Changed Table1 to "test++++" and the
value in Table2 remains "test".

I've got 5 years of Paradox experience and this is my
first go with Access. Was Access not installed
correctly/completely? Is there some Properties setting
that I need to address?
-----Original Message-----


I wasn't sure if it would work if the fields involved in the relationships weren't
the Primary Key in either table, but I just tried this with a couple of sample tables
and it worked fine for me.

I had a field txt1 in Table1 (unique Index, not the PK)
I had a field txt2 in Table2 (no index, not the PK)

I created a relationship with cascade update enforced between the fields. I then
made identical entries in both tables "test".
Afterwards, I changed the entry in
 
I must be missing a step? I set up the same two tables as
you did, enforced cascade update, set values in both
tables to "test". Changed Table1 to "test++++" and the
value in Table2 remains "test".

Is this the field that you defined as the linking field in the
relationships window, or some other field in the table? Only the
linking field will cascade!
 
Back
Top