Dlookup......" " and " "

L

learning_codes

Hi,

I need your help.

I want to look up in two columns before opening the queries. It works
for this line but I want to add after CheckLastName.

DLookup("[Last Name]", "Sport", "UCASE([Last Name]) like ""*" &
CheckLastName & "*""")

I'm looking for like this:

DLookup("[Last Name]", "Sport", "UCASE([Last Name]) like ""*" &
CheckLastName & "*""" and [Forecast_Only] is null)

Your help would be much appreciated.

Thanks
 
A

Allen Browne

Try something like this:

DLookup("[Last Name]", "Sport",
"([Last Name] like ""*" & CheckLastName & "*"") and ([Forecast_Only] is
null)"

JET is case insensitive, so the UCASE() is not doing anything useful. Then
you closed the quotes too early. The brackets are optional. If the quotes
don't make sense, see:
Quotation marks within quotes
at:
http://allenbrowne.com/casu-17.html
 

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