Dlookup w/multiple criteria

J

John

Whats wrong with this code?

when i put into a text box I get an #error.

I just want to add two criteria's to a dlookup statement
that is in a txtbox.

first criteria is where stop = yes
second criteria is where ID = 002.

What Is wrong here?

=DLookUp("StopComment","Version","[Stop] = 'Yes' AND [ID]
= '002'")
 
M

Marshall Barton

John said:
Whats wrong with this code?

when i put into a text box I get an #error.

I just want to add two criteria's to a dlookup statement
that is in a txtbox.

first criteria is where stop = yes
second criteria is where ID = 002.

What Is wrong here?

=DLookUp("StopComment","Version","[Stop] = 'Yes' AND [ID]
= '002'")


As long as both the Stop and ID fields are Text fields, it
looks ok to me.

OTOH, if Stop is a Yes/No field, then that part would be
Stop = True
and/or if ID were a numeric type field, then the second term
would be
ID = 002
 

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

Top