S
scott04
I have the following code in my database:
Private Sub case_no_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("Case_no", "tbllawsuittracking", "Case_no = " &
Me.Case_No)) Then
Cancel = True
MsgBox "This is a duplicate", vbExclamation, "Duplicate value!"
End If
End Sub
Case number is a text field in the tblLawsuitTracking table. What i am
trying to do is prevent a duplicate case number upon entry when entering data
in a form. Problem is I just can't seem to get the code working properly.
Any suggestions on why this isn't working?
Private Sub case_no_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("Case_no", "tbllawsuittracking", "Case_no = " &
Me.Case_No)) Then
Cancel = True
MsgBox "This is a duplicate", vbExclamation, "Duplicate value!"
End If
End Sub
Case number is a text field in the tblLawsuitTracking table. What i am
trying to do is prevent a duplicate case number upon entry when entering data
in a form. Problem is I just can't seem to get the code working properly.
Any suggestions on why this isn't working?