C
chynewalker
Hi,
I have a slight problem with my code, It is to prevent a number from being
entered multiple times, but occasionally i want a duplicate.
So i wrote this code to try to find the duplicate and prompt me to allow it
or not.
however it says every number exists already. what wrong?? help
thanks
john
Private Sub OEM___BeforeUpdate(Cancel As Integer)
If DCount("[OEM___]", _
"[drawings1]", _
"[OEM___] = '" & Me.OEM___ & "'") Then
If MsgBox("This OEM already exists!!!" & vbCrLf & "Add it anyway?", vbYesNo)
= vbNo Then
Cancel = True
Else 'Do nothing
End If
End If
End Sub
I have a slight problem with my code, It is to prevent a number from being
entered multiple times, but occasionally i want a duplicate.
So i wrote this code to try to find the duplicate and prompt me to allow it
or not.
however it says every number exists already. what wrong?? help
thanks
john
Private Sub OEM___BeforeUpdate(Cancel As Integer)
If DCount("[OEM___]", _
"[drawings1]", _
"[OEM___] = '" & Me.OEM___ & "'") Then
If MsgBox("This OEM already exists!!!" & vbCrLf & "Add it anyway?", vbYesNo)
= vbNo Then
Cancel = True
Else 'Do nothing
End If
End If
End Sub