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

How to display a message telling that the record already exist?

Status
Not open for further replies.

PNC

MIS
Jun 7, 2001
87
US
I have a form where users enter a new product code manually and the users would like to know after entering the new product code if the record already exist...right now there's a message which is error 3022 after entering all the fields in the forms, but they want the message after entering the first field.
 
Use the Dlookup function to find out if the no. is already being used. Durkin
alandurkin@bigpond.com
 
I assume that they get the error because you have a primary key set up on the product code. If this is the case, you could simply try to save the record on the after update event of the first field.

Docmd.Runcommand acCmdSaveRecord

This will cause the error message to be displayed immediately when a duplicate value is entered.

Mike Rohde
rohdem@marshallengines.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top