Question Error 2001 with Dlookup function (1 Viewer)

lynxbci

Registered User.
Local time
Today, 05:47
Joined
Nov 27, 2007
Messages
73
Hi
I have the following code in my form

Dim varX As Variant
varX = DLookup("[Product Description]", "tblproductlist", "[Product Code] = " & Me!txt_Product)

The expr is correct, there is a field called Product Description in tblproductlist
the table is correct, there is a table called tblproductlist
The field is correct, there is a field called product code in tblproductlist
The me!txt_product is returning the correct data

So why is it giving me the error 2001, which means the syntax is incorrect somewhere i beleive?

thanks in advance
 

MStef

Registered User.
Local time
Today, 05:47
Joined
Oct 28, 2004
Messages
2,251
If the Product Code is a string (txt), try next:
...................."[Product Code] = """ & Me!txt_Product & """")
 

lynxbci

Registered User.
Local time
Today, 05:47
Joined
Nov 27, 2007
Messages
73
2001: Not the most useful error message
Thankyou, working perfectly now
 

Users who are viewing this thread

Top Bottom