Connecting Tech Pros Worldwide Forums | Help | Site Map

Update Multiple Tables

Familiar Sight
 
Join Date: Apr 2007
Posts: 132
#1: Jul 12 '07
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.

FishVal's Avatar
Expert
 
Join Date: Jun 2007
Location: Israel
Posts: 2,584
#2: Jul 12 '07

re: Update Multiple Tables


Quote:

Originally Posted by Proaccesspro

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.

Hi!

DRI (Declarative referrential integrity) is all what you need to update/delete FKs when PK updated/deleted.
damonreid's Avatar
Expert
 
Join Date: Jul 2007
Posts: 113
#3: Jul 12 '07

re: Update Multiple Tables


I don't have any information on this but would like to subscribe to the topic. I don't know how to without posting in it, sorry.
Familiar Sight
 
Join Date: Apr 2007
Posts: 132
#4: Jul 12 '07

re: Update Multiple Tables


Quote:

Originally Posted by FishVal

Hi!

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?
hyperpau's Avatar
Expert
 
Join Date: Jun 2007
Posts: 177
#5: Jul 12 '07

re: Update Multiple Tables


Quote:

Originally Posted by Proaccesspro

Can you expand a little on the concept and where I could find more information on it?

this means you have to open the relationships window form access.

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.
Familiar Sight
 
Join Date: Apr 2007
Posts: 132
#6: Jul 12 '07

re: Update Multiple Tables


Quote:

Originally Posted by Proaccesspro

Can 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.
Reply