Lynn_AccessUser
Registered User.
- Local time
- Today, 11:43
- Joined
- Feb 4, 2003
- Messages
- 125
I have a form where a user can add a new record. I am trying to prevent duplicate records from being entered with the following code:
If DCount("[MobileNumber]", "tblMobileNumber", "[MobileNumber]=" & Me.txtMobileNumber) > 0 Then
MsgBox "The mobile number " & Me.txtMobileNumber & " is already assigned."
Cancel = True
Me.Undo
End If
However, I keep getting the following error:
Run-time error '2757':
There was a problem accessing a property or method of the OLE object
I am using almost the exact code on another form without any issues so I can't figure out what is causing the error.
The backend is a SQL 2000 backend with a Access 2000 adp frontend.
Thanks!!!!
If DCount("[MobileNumber]", "tblMobileNumber", "[MobileNumber]=" & Me.txtMobileNumber) > 0 Then
MsgBox "The mobile number " & Me.txtMobileNumber & " is already assigned."
Cancel = True
Me.Undo
End If
However, I keep getting the following error:
Run-time error '2757':
There was a problem accessing a property or method of the OLE object
I am using almost the exact code on another form without any issues so I can't figure out what is causing the error.
The backend is a SQL 2000 backend with a Access 2000 adp frontend.
Thanks!!!!