Results 1 to 3 of 3
  1. #1
    Turncloud is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2013
    Posts
    22

    2nd import always fails

    I am receiving some Excel data that I need to import in to an Access 2013 database on a weekly basis.



    The spreadsheet is really simple, just 3 columns

    Reference, Total Qty Shipped, Total Value Shipped

    If I clear out all the records from the table it imports fine, but if I try the import again it errors with
    Click image for larger version. 

Name:	error1.png 
Views:	14 
Size:	12.4 KB 
ID:	13391

    Now Reference is an indexed field - it's the factory code. I just want this import to refresh the values for the other two columns, overwriting anything there. There are many other fields in the database for each record, so I can't just replace the data.

    I'm sure this is a common issue but how do I get around it?

    Simon

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    Turncloud -

    IMO, it would appear as though the Reference field's index is set to Yes (No Duplicates). So, when you try to import/append the second time, the values won't be accepted because they would result in duplicate values. Usually, an append query, adds records to the table whereas an Update query changes existing field values. Therefore, at first glance, you have two separate processes to address. 1.) Adding Records (new data that doesn't exist in the table currently) and 2.) Updating (existing field values). If you just want certain field values updated, then create an update query with the fields that require updating.

    Hope this helps,

    Jim

  3. #3
    Turncloud is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2013
    Posts
    22
    Thanks Jim, I didn't understand quite what you meant at first but that got me on the right track. By creating and update query and an append query and then setting warnings off I was able to achieve the same result of updating existing records and then adding any new ones.

    Thanks for your help

    Simon

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

Similar Threads

  1. Access 2003: import of csv fails due to period in filename
    By vanthien in forum Import/Export Data
    Replies: 5
    Last Post: 01-12-2013, 07:03 PM
  2. Access 2003: import csv fails as csv is still open
    By vanthien in forum Import/Export Data
    Replies: 3
    Last Post: 01-06-2013, 07:46 PM
  3. SQL Insert Into Fails
    By Randy in forum Access
    Replies: 2
    Last Post: 12-14-2012, 05:26 PM
  4. query fails
    By rjjhome in forum Queries
    Replies: 4
    Last Post: 03-15-2012, 05:19 PM
  5. Requery fails
    By Dega in forum Forms
    Replies: 3
    Last Post: 09-28-2010, 08:35 AM

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