access table field update

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jim Klein
    New Member
    • Jul 2011
    • 1

    access table field update

    Have 2 tables with common ids. Want to update field1 in table 1 with data in field1 table 2 if the recs match.

    Suggestion?

    Project for St Vincent de Paul Society Conference at St Hilary's Church, Fairlawn, OH
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    You need UPDATE with a JOIN.
    There are about three ways of writing the query, I am not sure which if not all are valid in Access. But basically
    Code:
    UPDATE table1
    JOIN table2 ON table1.id = table2.id
    SET table1.field1 = table2.field1
    WHERE table1.field2 = table2.field2

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32633

      #3
      My suggestion would be not to update the other table at all. Normalised data (See Database Normalisation and Table structures) is never repeated unnecessarily. When you need access to the data, simply query it using the link.

      Comment

      Working...