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

Trapping for Duplicate entries

Status
Not open for further replies.

webwevers

Programmer
May 10, 2002
15
US
I have a form that saves monthly stats in. I would like to have the form give me an error message when the user types in the same division, month and year. These are 3 fields in the form. If a user enters the same division, month and year it would give me an message box telling me that that division, month and year is already entered in the database. Thanks for any help.
 
Take a look at the DLookUp or DCount function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
have you considered making the division/month/year field combination the primary key? or maybe just a no-duplicates index on the 3 fields

- RoppeTech
 
All three fields need to be checked. For example, Feb, headquarters, and 2004 might be a record and Feb, headquarters, 2003. Also Jan. headquarters, 2004. I need to only enter the data when all three fields are looked at, I then need an error message box, when a record already has those three same fields entered. Thanks for any help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top