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

Primary Key and Violation

Status
Not open for further replies.

Tarbuza

Technical User
Dec 13, 2000
56
0
0
US
How can I check while executing Insert that if it is a primary key violation then it should do Update?

What error code Access generates if it encounters inserting the same primary key? Thanks in advance for any help.
 
The error is 3022. If you look in access help you can find all of these types of error messages under the topic Microsoft Jet Error Message Reference. There are several ways to deal with this error. You can:

1) Check for duplicates before you try to insert the record

or

2) Check for the error after you have inserted/attempted to insert the record.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top