I have an Access database that contains multiple tables. How can I update a field in all of the tables with a search and replace funtion? In other words, one of the forms has a button that will allow the user to update a primary key that may have been mis-keyed from the start. The idea is that the user would have the ability to correct the mistake by searching for the incorrect key and replacing it with the correct key. To do this, 5 or so tables would have to be updated.
Update Multiple Tables
Collapse
X
-
Tags: None
-
Hi!Originally posted by ProaccessproI have an Access database that contains multiple tables. How can I update a field in all of the tables with a search and replace funtion? In other words, one of the forms has a button that will allow the user to update a primary key that may have been mis-keyed from the start. The idea is that the user would have the ability to correct the mistake by searching for the incorrect key and replacing it with the correct key. To do this, 5 or so tables would have to be updated.
DRI (Declarative referrential integrity) is all what you need to update/delete FKs when PK updated/deleted. -
Originally posted by FishValHi!
DRI (Declarative referrential integrity) is all what you need to update/delete FKs when PK updated/deleted.
Can you expand a little on the concept and where I could find more information on it?Comment
-
this means you have to open the relationships window form access.Originally posted by ProaccessproCan you expand a little on the concept and where I could find more information on it?
meaning, no form, tables, querios or reports are open. then you click the relationships button from the toolbar.
Then you double click the lines that connects your tables in that window and then check the checkbox that says referrential integrity. then 2 more check boxes will be enabled "cascade delete" and "cascade update". Just check on those and click ok.
now everytime a PK is edited or deleted in one table, all the tables that has that PK are updated or deleted as well.Comment
-
Originally posted by ProaccessproCan you expand a little on the concept and where I could find more information on it?
I found some information regarding the subject....OK, so do you have any ideas on the best way to integrate this functionality?? I would rather not use the standard search and replace box offered in Access to accomplish this.Comment
Comment