dlookup

mr moe

Registered User.
Local time
Today, 20:04
Joined
Jul 24, 2003
Messages
332
hi guys can somone help?

I"m creating a dlookup query it only works when i inlude the value but not when i refere the value to a form. for example


Nz(DLookup("[ID]", "[ID_tbl]" _
, "[Comments] like 'ABC'")) Is working

but when i refere the ABC value to the form it's not working see below
Nz(DLookup("[ID]", "[ID_tbl]" _
, "[Comments] like '*&[Forms]![my_frm]![myfield]&*'"))

i'm getting an empty result.
thanks for your help.
 
You need to space the & out from the rest and you need a couple of quotes (see red).

Nz(DLookup("[ID]", "[ID_tbl]", "[Comments] like '*" & [Forms]![my_frm]![myfield] & "*'"))
 
You need to space the & out from the rest and you need a couple of quotes (see red).

Nz(DLookup("[ID]", "[ID_tbl]", "[Comments] like '*" & [Forms]![my_frm]![myfield] & "*'"))

Thank you so much it's working :) :)
 

Users who are viewing this thread

Back
Top Bottom