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

Finding Duplicate records

Status
Not open for further replies.

tdonahue

Technical User
Feb 4, 2001
50
US
I have a table that a specific field can't have a duplicate record in it. I have the property in the table set to no duplicates. The name of the field is serialnumber. My form has 20 fields in it. The problem is I have to go through all twenty fields before I get the error message that the table has a duplicate record. The first field on the form is the serial number field. How can I change my form so it verifies the record isn't a duplicate immediatly.


Thanks in advance
 
In the AfterUpdate event write

If Dcount("*","TableName","serialnumber = " & me!serialnumber)>0 Then
Me.Undo
End If

Hope it helps
Mangro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top