key violations

L

Lisa

I am trying to append info from a 2003 database into a 2007 database and have
received the Key violation error. My first question is, what is a key
violation error and how do I correct it? I am a novice so simple answers
would be very helpful. :)
Lisa
 
J

John Spencer MVP

Key violation error can occur
-- if you are trying to add duplicate values to the primary key field
-- if you are trying to add values to a foreign key field that don't exist in
the "parent" table and you have enforced the relationship.

You fix it, by identifying which record(s) are causing the problem and either
fixing the data or excluding them from the append query.


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
J

John W. Vinson

I am trying to append info from a 2003 database into a 2007 database and have
received the Key violation error. My first question is, what is a key
violation error and how do I correct it? I am a novice so simple answers
would be very helpful. :)
Lisa

It means that you are trying to create two records with the same value in a
field with a unique Index (such as a primary key), or you are trying to create
a record which violates a relationship (i.e. trying to create a child record
with no corresponding parent in some related table).

Check the table into which you are appending. Does it have a Primary Key? If
so might you be trying to add a record with a primary key value that already
exists? Open the Relationships window: does this table have relationships to
other tables?
 
L

Lisa

John,
Thank you for your response. I did a little more research and I was able to
figure it out. I was able to finally achieve the result I wanted!

Lisa
 
L

Lisa

John,
Thanks for the reply. I was able to figure it out and did achieve the result
I wanted. This forum is a great place to get help and answers!
Lisa
 

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