Solved

append query key violations

Posted on 2004-04-26
2
446 Views
Last Modified: 2012-05-04
I have an append query:
INSERT INTO SupplierContacts ( [Creditor No], OfficeNumber, FirstName )
SELECT Suppliers.[Creditor No], Suppliers.Phone, Suppliers.Contact
FROM Suppliers;

it fails because of 'key violations'
0
Comment
Question by:robiago
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
Try this

INSERT INTO SupplierContacts ( [Creditor No], OfficeNumber, FirstName )
SELECT Suppliers.[Creditor No] As [Creditor No], Suppliers.Phone As [OfficeNumber], Suppliers.Contact As FirstName
FROM Suppliers;

Key violations
Do you have any fields with no  duplicates allowed?
0
 
LVL 1

Expert Comment

by:dssdb
Comment Utility
Key violations are caused by duplicate information being inserted.  You may have data in your Suppliers table that already matches the SupplierContacts.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now