Results 1 to 4 of 4
  1. #1
    Erictsang is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    154

    Update of Table Problem

    Dear all

    I have some confusion on updating a table from EXCEL



    i have import data from an excel field
    ID
    Fname
    Lname
    Tel

    then i have another one to update to the above table
    ID
    Fname
    Lname
    Tel
    Salary

    Should i import it again and overwrite or Append?
    I try both but not working


    Wonder why

    Eric

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    the excel file should be linked in the db as an external table.
    make 2 queries: ( to do both), append and update

    1 make an append query to get items that do not exist.
    in the query you need both the data table and the XL table,
    join the 2 on ID,
    dbl-click the join line, and make an OUTER join....all records in access table, some recs in XL table.
    bring down the ID of both tables,
    under the XL.ID set criteria to NULL, (this will only allow MISSING xl records to get added, so you dont import existing ones to get duplicates)
    append to target table.

    2. make an update query
    again, join the 2 tables but INNER join
    since now all records exist, you will change everyone.

    put both queries in a macro,
    run the macro.

  3. #3
    Erictsang is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    154
    Thanks but i do not understand about the inner join and outer join

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Use the query wizard to create an unmatched query - records from the second table which do not match the first table. Then change this into an append query. This will add all the records from the second table which do not exist in the first table.

    Then have an update query which will update the first table with data in the second table.

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

Similar Threads

  1. Update table problem
    By mmiklauz in forum Access
    Replies: 9
    Last Post: 07-26-2017, 07:09 AM
  2. Entry Update Form Problem with the update
    By cuddles in forum Forms
    Replies: 1
    Last Post: 05-30-2014, 02:38 PM
  3. Query table update problem
    By sroy in forum Forms
    Replies: 1
    Last Post: 06-17-2013, 02:41 AM
  4. Replies: 1
    Last Post: 02-08-2012, 04:50 PM
  5. Replies: 1
    Last Post: 01-22-2011, 12:23 PM

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