Append data - key violation

C

Casa

Hello all;

I'm trying to append 122 records to a table. The key in the table which
contains the 122 records is "sample#", same as the key in the master table.
The append query didn't work -- I got a key violation message.

I checked the master table and those sample numbers (which correspond to the
122 records) do not exist there. I'm at a loss how there could be a key
violation. I never set up any foreign keys (at least, intentionally).

I got to the point of removing the primary keys off both tables and trying
to append the records. I still got a key violation error. I have no idea
why this is happening.

I can export my master table, add the records in Excel, then reimport the
master table back into Access and re-establish my "sample#" primary key, and
it works fine. But that's not the proper way of doing things.

What am I missing here?

Thanks for your help,
Michele
 
K

KARL DEWEY

What I would do is to run a match query to verify if duplicates are the
violation.
If not, then add a new field and update it with something like "Old data" to
distinguish records.
Then append even with the violation.
Then run a No-match query to see what was not appended and analyze why.
 
C

Casa

Thank you for your help. I took a close look at the tables involved, and
discovered the problem. One of the fields (in both tables) was designated as
an autonumber field. I guess they weren't jiving (even though those fields
weren't classified as the primary key), and that's why I got the key
violation.

I didn't need to append the autonumber field, so I took it out. I tried the
append, and it worked perfectly fine.

Casa
 
G

Ginger Holbrook

Casa said:
Thank you for your help. I took a close look at the tables involved, and
discovered the problem. One of the fields (in both tables) was designated as
an autonumber field. I guess they weren't jiving (even though those fields
weren't classified as the primary key), and that's why I got the key
violation.

I didn't need to append the autonumber field, so I took it out. I tried the
append, and it worked perfectly fine.

Casa
 

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