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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Queries and Key Violations

Status
Not open for further replies.

ebrooks54

IS-IT--Management
Dec 4, 2002
54
US
Maybe I'm just not seeing clearly, but it seems like it should be simple enough to do:

Two tables:
History Table: ProdCode / Description / TotSales
Transact Table: ProdCode / QtySold

I want to do an update query that increments TotSales in the History Table, or if the ProdCode does not exist to add the record.

If the ProdCode already exists in the History table, I get a "Key Violation" error.

What am I missing?
 
On query cannot do both update and add record actions.
You need an Update query where there is a match between the two tables.
And a separate Insert query where there is no match between the two tables.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top