Microsoft
Software
Hardware
Network
Question : Dlookup to prevent duplicate entries
I have the following code in place to check for duplicate entry in [Certificate Number]. Each time I test it with duplicate date I get an error message telling me I
cancelled the previous operation. I'm sure I've messed up the syntax for the dLookup function. Can anyone help?
Thanks!
Rose Marie
--------------------------
-Begin code--------------------
Private Sub Contract_Number_BeforeUpda
te(Cancel As Integer)
If DLookup("[Certificate Number]", "tblAFRateMovement", "[Certificate Number] = '" & Me.txtContractNumber & "'") Then
Me.Undo
MsgBox "Warning! Certificate Number " _
& txtContractNumber & " has already been entered." _
& vbCr & vbCr & "Please try again.", vbExclamation, "Duplicate Certificate Number!"
End If
End Sub
-------------------------E
nd code----------------------
----------
--------
Answer : Dlookup to prevent duplicate entries
PAQed with points refunded (125)
Computer101
EE Admin
Random Solutions
How to populated a row of a subFORM, with too much collumns of values and no scrollbars
access 2003 parse data length undetermined
SCCM 2007 Constant Despooler error 4406
Outlook 2007 Continuous Authencication
Same form on different computers
insert image via bookmark
Access attaching a file as xls when it should be rtf
active directory, W2k8 R2 DC, Kerberos failures, Event ID: 3, 4771, 4769, 4768, 4776, 4625 source: Microsoft Windows security
How to restrict on categories with recurrent items using VBA in access
video card driver