Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append query gives "Key Violation" error???

Status
Not open for further replies.

knorth1233

IS-IT--Management
Sep 23, 2002
3
CA
I have two inventory tables, one named "Unvin" and the other called "Unvin2". For reasons that may not be easy to explain, we need to move a field called "Misc4" out of the Unvin table and place the values into the Unvin2 table and into a new field named "EngineDesc". The two tables currently are joined by their primary key called UnitID in both tables. An empty field called "EngineDesc" currently exists in the Unvin2 table. I thought that the best way to update the Unvin2 table would be to use an Append Query. Unfortunately I keep getting an error message that says "zero records were udated because of a Key Violation".

I don't know if what I am doing is fundimentally wrong and that perhpas I need a different method to update the Unvin2 table, or is my query layout is just flawed.

Can anybody help with this?

Thanks

Ken

 
It could be that the table that you are appending to has PK's that are the same as the PK's that you are trying to append.

Check the PK of the records that you are trying to append against the already resident PK's of your target table. If they are the same you have your answer.

Try appending your records whilst ommiting the PK field, your target table will generate new PK's if it needs them.

(.....are you sure you simply need to add these records...have you thought about design and having the EngineDesc field set as another table with one field in your target table referencing the engine in the other table...)
 
Does the record you're trying to append aready exist in the target table? If the key field is already in use there you cannot use an Append Query. Perhaps you need an Update Query?

Larry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top