Results 1 to 5 of 5
  1. #1
    acrowe97 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Aug 2018
    Posts
    41

    Update data in another table

    I have a table that has a first and last name, phone number with extension, as well as another phone and extension. I have another table with first and last names, as well as fields with the same names and need to transfer this info to the other table. I know a query would do the trick, I just don't know how to set it up. I need kind of like a VLOOKUP-type update style (matching fields and updating certain info attached to those fields). Please advise, thanks!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    make a query, bring in both tables,
    join the fields: FIRST, LAST.
    change the query to UPDATE
    bring down the fields you want to update onto the grid
    in the UPDATE TO row , put what you want to change it to. Like:

    (field) tClient.Phone
    (update to) tTemp.Phone

  3. #3
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    One word of warning.
    If you have several people with the same first and Last names, the data could be incorrectly updated doing what Ranman suggested.
    For example the data for one John Smith could get muddled with another.

    That's why Access uses primary key fields so each record can be uniquely identified.
    Instead join the two tables by the primary key fields in the update query
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  4. #4
    acrowe97 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Aug 2018
    Posts
    41
    The only issue I think I'd have with that is the data is related through other tables. From Tenants>Leases>Suites>Permissions; Tenants (main contact info) and Permissions (employees of main contact) both have the same info on them, and the main contact info needs to be added to Permissions. Will this affect how the operation occurs?

  5. #5
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Do the two tables have a matching PK field e.g. ID?
    If so, then you'll have no problems.

    If not, then you can't do the update without a risk of data being muddled for those with identical names.
    So in that case I would strongly recommend you sort out a matching PK field first
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 06-07-2018, 07:08 AM
  2. Replies: 5
    Last Post: 08-25-2015, 08:39 AM
  3. Replies: 1
    Last Post: 05-31-2015, 09:20 AM
  4. Replies: 5
    Last Post: 09-06-2013, 11:52 AM
  5. Replies: 6
    Last Post: 05-10-2012, 08:20 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums