DLOOKUP error

mithani

Registered User.
Local time
Today, 17:31
Joined
May 11, 2007
Messages
291
Hi,

I am trying this code to show my product based on supplier code:

Me.txtsupplier = DLookup([products], "SUPPLIER", "[SUPPLIER_CODE] = '" & Forms!TRYING1!Text5) & "'"

but showing error: Run Time error 3075 - Syntax error in string in query expression '[supplier_code = '1001'.

Thanks

mithani
 
You need to close out the single quotes inside the parentheses, not outside:


Me.txtsupplier = DLookup([products], "SUPPLIER", "[SUPPLIER_CODE] = '" & Forms!TRYING1!Text5 & "'")
 
Thanks Pbaldy,

Showing error "Run Time error 2001, You cancelled the previous operation".

Any help

mithani
 
Sorry, products needs to be a string:

Me.txtsupplier = DLookup("[products]", "SUPPLIER", "[SUPPLIER_CODE] = '" & Forms!TRYING1!Text5 & "'")

Also, is the code a text value in the table?
 

Users who are viewing this thread

Back
Top Bottom