3239
Technical User
- May 14, 2003
- 64
I keep getting this error. The code is looking for duplicates in my Autonumber field which is long data type.
What data type do I have to use to get this code to work.
Please Help!!
Thanks.
What data type do I have to use to get this code to work.
Please Help!!
Thanks.
Code:
Dim lngPOID As Long
Dim lngLinkCriteria As Long
Dim rsc As DAO.Recordset
Set rsc = Me.RecordsetClone
lngPOID = Me.POID.Value
lngLinkCriteria = "[POID]=" & "'" & lngPOID & "'"
'Check Purchase Order table for duplicate Purchase Order Number
If DCount("POID", "PurchaseOrder", _
lngLinkCriteria) > 0 Then
'Undo duplicate entry
Me.Undo
'Message box warning of duplication
MsgBox "Warning Purchase Order Number " _
& strPOID & " has already been entered." _
& vbCr & vbCr & "You will now been taken to the record.", _
vbInformation, "Duplicate Information"