Correct syntax for Dlookup

W

Will Sellers

I am trying to get the value of a field in a supplier profile table so that
I can perform actions based on file type. The criteria comes from an open
form
This is my syntax but I can't get it to work

varX = DLookup("[ImportTabFile type]", "supplier profile", "[supplier code]
=" & Forms![select Supplier]!dummy)
 
J

John Vinson

I am trying to get the value of a field in a supplier profile table so that
I can perform actions based on file type. The criteria comes from an open
form
This is my syntax but I can't get it to work

varX = DLookup("[ImportTabFile type]", "supplier profile", "[supplier code]
=" & Forms![select Supplier]!dummy)

If [Supplier Code] is a Text field you need the syntactically required
quote marks. I'd also suggest putting brackets around the table name
since it contains a special character (a blank):

varX = DLookup("[ImportTabFile type]", "[supplier profile]",
"[supplier code]='" & Forms![select Supplier]!dummy & "'")


John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top