You have the VBA procedure but it is not associated with the control event. In the event BeforeUpdate property select [Event Procedure] then click the ellipsis (...) to open VBA editor at the procedure.
Also, the DLookup syntax is wrong. Doesn't have the table/query argument. Don't need table/form name prefix. Also, I goofed, don't need line to set field to False. I got this to work:
Code:
Private Sub PRIMARY_VIOLATION_IND_BeforeUpdate(Cancel As Integer)
If Me.PRIMARY_VIOLATION_IND = True Then
If Not IsNull(DLookup("PRIMARY_VIOLATION_IND", "COMPLAINT_VIOL", "CUSTOMER_ID =" & Me.CUSTOMER_ID & " AND PRIMARY_VIOLATION_IND =True")) Then
Cancel = True
'Me!PRIMARY_VIOLATION_IND = False
MsgBox "This customer already has a record identified as Primary Violation."
End If
End If
End Sub