Dlookup w/multiple criteria

  • Thread starter Thread starter John
  • Start date Start date
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'")
 
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
 
Back
Top