Changing values in Primary and Secondary keys

S

stumped

Is there a way to change the value of a primary key and automatically change
the value in all linked secondary keys.
 
D

David Conger [MSFT]

You need to make a relationship between the two fields, enforce referential
integrity, and cascade the update. Sounds like a lot, I know...it is pretty
easy. In your database, go to Tools -> Relationships. Add the approriate
tables. You need to create relationships between fields that are linked (if
you haven't already). Do this by draging and dropping the primary key field
onto the secondary field . When you do this, an edit relationship dialog
will appear. You need to check "Enforce Referential Integrity" and "Cascade
Update Related Feilds." That's it! Now when you change a primary key, all
secondary keys that have a relationship to the primary key will get updated
automatically.

--
David Conger
Software Development Engineer in Test
Microsoft Office Access

** This posting is provided "AS IS" with no warranties, and confers no
rights. **
 
Top