This is usually done using the DCount() function rather than a full blown Query. The exact syntax depends on the Datatype of the Field being used.
Replacing Field1 with the actual name of your Field/Control, and Domain with the name of the Table or Query that holds the Field:
If Field1 is Text
Code:
Private Sub Field1_BeforeUpdate(Cancel As Integer)
If DCount("Field1", "Domain", "[Field1] = '" & Me.Field1 & "'") > 0 Then
Resp = MsgBox("This Value Already Exists! Do You Wish to Add Anyway?", vbYesNo)
If Resp = vbNo Then
Cancel = True
End If
End If
End Sub
0f Field1 is Numeric
Code:
Private Sub Field1_BeforeUpdate(Cancel As Integer)
If DCount("Field1", "Domain", "Field1 = " & Me.Field1) > 0 Then
Resp = MsgBox("This Value Already Exists! Do You Wish to Add Anyway?", vbYesNo)
If Resp = vbNo Then
Cancel = True
End If
End If
End Sub
Linq ;0)>