Help Please...

G

Guest

Hello,

I am trying to import excel spreadsheets into Access but I am having little
success. I can import the spreadsheet as a new table but when I try to append
to my contacts table Access tell me it can't import all of the records
because of key violations. My contacts table is empty. The records I want to
import does not have the same number of fields as the contacts table. The
primary key in the contacts table is an autonumber. Should I have a contactID
in the table I want to append. I don't understand how I will be able to
import the fields if there is no contact ID number in my imported table and
my contacts table is emply. Will they records be added and the next available
autonumber be used.

I don't know if I am making myself clear. I am having a bit of a problem
understanding why some of these records are added to my contacts table and
some aren't. I am using Access 203.

Is there are site they could help me understand what to do when I get these
error messages.

Thanks in advance for any help.
 
K

Ken Snell \(MVP\)

You are doing the right first step when you import the spreadsheet's data to
a temporary table. That gives you the most effective control over the data
when you copy it (by an append query) to your permanent table.

The error that you are getting when you run the append query likely is
caused by one of four things:

1) you have mismatched the fields from the temporary table with the
fields that are to receive the data; we'd need to see the SQL statement of
the append query to give more information about this.

2) you are trying to write data into the primary key field of the table
that is receiving the data, and the data are not unique for that field;

3) you are writing nonunique data into one or more fields that are part
of a unique index in the table that is receiving the data;

4) you are not writing data into the primary key field in the table that
is receiving the data, and that primary key field is not an autonumber field
so it is expecting you to provide a value for it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top