Hello-
I have the following code to prevent duplicate entries in one of my fields:
Private Sub txtWWID_BeforeUpdate(Cancel As Integer)
If DCount("WWID", "Updated Headcount", "[WWID] = '" & Me.txtWWID & "'") > 0 Then
MsgBox ("This Value Already Exists! Please Enter New Value")
Cancel = True
End If
End Sub
I need the code to lookup to see if the value exists in the WWID column AND look in the field named "Number" for a value 1. If the value exists in the WWID field AND has a 1 in the Number field then the message box pops up to prevent the entry.