Update Multiple Tables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Proaccesspro
    New Member
    • Apr 2007
    • 132

    #1

    Update Multiple Tables

    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
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    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.

    Comment

    • damonreid
      Recognized Expert New Member
      • Jul 2007
      • 114

      #3
      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.

      Comment

      • Proaccesspro
        New Member
        • Apr 2007
        • 132

        #4
        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?

        Comment

        • hyperpau
          Recognized Expert New Member
          • Jun 2007
          • 184

          #5
          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.

          Comment

          • Proaccesspro
            New Member
            • Apr 2007
            • 132

            #6
            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.

            Comment

            Working...