duplicate records check

bacardi451

Registered User.
Local time
Today, 14:45
Joined
Mar 20, 2002
Messages
33
I have a form where I have a "case no." field. what I would like to do is to have a event procedure in the field to check if the case no. was taken already (duplicate) the field already is set to unique in the table.
I have search everywhere with no luck.

thank you
AL
 
You could use the DCount function to get a count a then check that. Example...

If DCount("*", "[tblCases]", "[Case No]=" & txtCaseNumber) > 0 Then
Msgbox "This is a duplicate"
End If

Where [tblCases] is the table that contains these case numbers, [Case No] being the field in the table and txtCaseNumber being the field on the form.

Hope that helps,

ih.
 

Users who are viewing this thread

Back
Top Bottom