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

Message Box for Duplicate Entry

Status
Not open for further replies.

vbridge

Technical User
Jun 27, 2005
15
US
I have the "Title" as my primary key and when the user goes to save the form, if the title they have entered already exists a message box appears. However, this message box is unclear as to which field is the duplicate. I want to create a message box that appears as soon as the user tabs out of the title field if it is a duplicate. I am extremely unfamiliar with VBA. I have just been experimenting with different things trying to see if I can figure it out. I got the message box to come up when they left the field, but it comes up whether it is a duplicate or not! Please help! Thank you sooo much!
 
In the BeforeUpdate event procedure of the [title] control play with the DLookUp & MsgBox functions and the Cancel parameter.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top