Results 1 to 9 of 9
  1. #1
    Jamescdawson is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2012
    Location
    South Wales, UK
    Posts
    98

    Angry Importing records into an existing table

    I'm feeling a bit thick... I have an existing table "Customers" and have an excel spreadsheet of 100 new customers which I want to import/append onto my "Customers" table. I need the table to generate the customer ID key, (which will be used for linking to other tables) but I just can't get the records to import.



    I use the Excel import button but I get the dialogue box telling me that Access failed to import

    What am I missing or doing wrong ?

    frustrated !

    Jimbo

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Is the customer ID an autonumber type field?

    You are using the import wizard?

    Are the field names the same?

    Is there more info in the error message?

    If you want to provide files for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Jamescdawson is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2012
    Location
    South Wales, UK
    Posts
    98
    Hi June7, Thanks for the prompt response...

    Yes, the CustomerID is AutoNumber... (Why do you ask that?... I keep coming back to the problem being in the autonumbering of the destination field but no rationale)
    Yes, I was using the import wizard
    Yes, field names the same for the field in source and destination (I checked them to be so in an attempt to overcome issue)
    Error message - See below....

    Click image for larger version. 

Name:	Error from Excel.jpg 
Views:	12 
Size:	58.4 KB 
ID:	20760


    I took another tack and imported the excel data into a new table and then tried to append the data using the Append query. Again, No records imported but this time the error message said it was because of "Validation Violations". I have checked every single field and there are no validation rules set.

    Still frustrated

    Jimbo

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    I ask about the key to confirm this is not an imported value.

    Are there any indexes set aside from the primary key field?

    As enumerated in the error message, failure could be due to a number of causes. Would have to examine files.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Jamescdawson is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2012
    Location
    South Wales, UK
    Posts
    98
    June7

    Thanks for that... I had the PostCode indexing. When I got your last reply, I removed the indexing from the Post Code and tried again. It failed again on Validation Violations.

    I then removed any indexing from the source file - That failed too.

    I've attached a db with the two tables (source and destination) test data

    Can you append "sheet1" data to "Clients & Customers" ?

    Jimbo
    Last edited by Jamescdawson; 05-18-2015 at 03:59 PM.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Record 2 in Sheet1 has a space in the PostCode value.

    Testing1 does not have fields except for the ID autonumber. APPEND requires fields to be in place. I added fields to Testing1. Moved the ID field to the end of the fields in table design view. Then this simple SQL works:

    INSERT INTO Testing1 SELECT * FROM Sheet1;

    Clients & Customers has more fields than the imported data. The common fields are not in the same order.

    Advise not to use spaces and special characters/punctuation (underscore is exception) in naming convention.

    I prefer Overlapping Windows option for db setup so I can see objects like tables and queries side by side.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Jamescdawson is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2012
    Location
    South Wales, UK
    Posts
    98
    Thanks for having a look.
    Testing wasn't meant to have data/fields

    The elements in question were Clients & Customers and Sheet1 contaed the data that I was trying to get into Clients & Customers.

    I'll keep playing with it. Still can't see the reason for the Validation violation

    Jimbo

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    RefNumber field in Clients & Customers is required. This is the validation that is causing failure.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    Jamescdawson is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2012
    Location
    South Wales, UK
    Posts
    98
    June7

    You're a star. Well spotted.. I just don't know how I missed that !!! A whole day wasted faffing around with that.

    Many Thanks

    Best Regards

    Jimbo

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

Similar Threads

  1. Field F9 error when importing Excel file to existing table
    By dougdrex in forum Import/Export Data
    Replies: 2
    Last Post: 12-26-2014, 01:38 PM
  2. 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
  3. Replies: 2
    Last Post: 05-21-2012, 08:46 PM
  4. Importing Excel data to an existing table
    By tonyrhills in forum Import/Export Data
    Replies: 3
    Last Post: 12-23-2011, 09:19 AM
  5. Adding records to existing table
    By Mclaren in forum Programming
    Replies: 5
    Last Post: 05-18-2011, 12:44 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