Results 1 to 6 of 6
  1. #1
    IannWard is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    16

    Thumbs up Import from a spreadsheet and overwright existing data

    Hi All


    I have a table with product information consisting of half a dozen fields. We recently updated some of our remote systems and the new data was recorded on a spreadsheet. I was to import the data into my database and update some of the fields with the new info, for example:

    Database table has 4 fields:
    Serial Number - 98746321
    Asset Tag - 00001526
    Location - Our Stock
    Item Description - Dell5810


    Spread sheet has 3 columns:
    Serial Number - 98746321
    Asset Tag - 00001526
    Location - 0250


    As you can see, the location has changed..... and there is no item description on the spreadsheet.
    If I try the usual import spreadsheet route I will get a "Duplicates" error.
    How can I import the spreadsheet and have it only change the fields where the data has changed?
    I'm sure this is simple to you experts but if you can help with full instructions including any code, that would be great.
    There are 7500 entries to update, so will take too long to manually search each serial number in a form and make the changes there.

    Many Thanks

    Iann

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Import the data into a new, temporary table.
    Then join this temporary table to your main table, joining on your key fields (Serial Number and Asset Tag, presumably) and update the fields you want using an Update Query.

  3. #3
    IannWard is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    16
    Hi Joe
    Many thanks for your quick response.
    I have created a temp table and copied in the data. I have opened a query, inserted both tables, joined the common fields and in the query design grid I have entered the destination field and table and in the 'update to' cell I entered [SerialNumbersTemp].[Serial Number]
    When I run the query I get the error 'Type mismatch in expression'... Can you please help?

  4. #4
    IannWard is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    16
    Hi Joe

    My apologies, I got it working, I joined two fields that had different data by mistake. un joined them, left the serial number joined and it worked a treat.

    Thanks a million for your help.

    Iann

  5. #5
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You're most welcome!

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Oops, got distracted with work... was going to cancel... hit the wrong button.

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

Similar Threads

  1. Replies: 1
    Last Post: 04-25-2015, 01:44 PM
  2. Replies: 1
    Last Post: 04-25-2015, 01:41 PM
  3. Importing Excel spreadsheet and appending it to an existing table
    By Access_Novice in forum Database Design
    Replies: 3
    Last Post: 08-21-2014, 07:01 AM
  4. Import Excel data into existing Access Table
    By octsim in forum Import/Export Data
    Replies: 4
    Last Post: 10-24-2013, 07:21 AM
  5. Replies: 4
    Last Post: 01-14-2013, 09:35 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