Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dlookup not working for text?

Status
Not open for further replies.

mikelev

Technical User
Mar 23, 2004
223
0
0
US
Well I thought I had the statement correct, but it only works for numbers not text?

Works:
= Nz(DLookup("DESCRIPTION", "TABLES", " TABLENUM='" & 1 & "'"), "N/A")

Does not work:
= Nz(DLookup("DESCRIPTION", "TABLES", " TABLENUM='" & P1 & "'"), "N/A")


Any help would be appreciated.
 
Is P1 a variable or a literal ?
= Nz(DLookup("DESCRIPTION", "TABLES", " TABLENUM='P1'"), "N/A")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
In this case it is a literal.

Thanks PHV
 
I have a very similar situation, where I need to look up users that have a "position" = "Dealer". I tried the following with no luck?

= Nz(DLookup("fullname", "tbluser", " POSITION='Dealer'"), "N/A")

Thanks as always for you help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top