Error 2465 (1 Viewer)

cyd44

Registered User.
Local time
Today, 17:26
Joined
Oct 30, 2011
Messages
85
I am trying to test for a duplicate value entered on a form and have the following code:-

Code:
If IsNull(DLookup([ID], [Patient_Detail], [Web_UID] & "='" & Me.Web_UID & "'")) Then
Tester = True
Else
GoTo DupErr
End If

When I run the form I get the 2465 error and yet the values of ID, Web_UID and Me,Web_UID can be seen in debug mode. The Dlookup is clearly working but why is it creating an error?
 

RuralGuy

AWF VIP
Local time
Today, 10:26
Joined
Jul 2, 2005
Messages
13,826
*All* of the arguments of the Domain functions are strings.
 

cyd44

Registered User.
Local time
Today, 17:26
Joined
Oct 30, 2011
Messages
85
Thanks Rural

I changed the square brackets to "" and it worked.......Thanks for that
 

RuralGuy

AWF VIP
Local time
Today, 10:26
Joined
Jul 2, 2005
Messages
13,826
Try:
If IsNull(DLookup("[ID]", "[Patient_Detail]", "[Web_UID] ='" & Me.Web_UID & "'")) Then
 

Users who are viewing this thread

Top Bottom