Textbox to be used as Expression in Dlookup

thescottsman

Registered User.
Local time
Today, 14:39
Joined
Sep 18, 2014
Messages
42
Hi All

I am ot sure whether this is possible or not.

I want to set the expression of a dlookup to be a text field on the form.

This will allow me to be versatile on the form if I can do this.

Is this possible

Thanks in advance
 
'below is for string value. (if numeric, remove the quotes)

msgbox dlookup("[field]","table","[field2]='" & txtBox & "'")
 
Thanks for your reply - Its not what I quite meant

Its

Dlookup("me.text","tbl_Help","[Name]='" & me.name & "' ")

where me.text is the textbox but the name of the column heading
 
that's not right...
the 1st param in dlookup is the FIELDNAME to return.
Dlookup("me.text") im guessing is not a field name.
AND it cant be in quotes...
Dlookup(me.text)
(you don't use .text, just the name of the box , me.TxtBox)

the 3rd param is the WHERE clause, me.name is not the value in the box.
you want me.txtBox
it will pull the value from the box.
 
I know that this is not the normal way to use a dlookup

I know the first part of a dlookup is the field that you want to lookup. The name of the field will be the same as the value in the textbox, hence wanting the textbox value in that part of the dlookup
 

Users who are viewing this thread

Back
Top Bottom