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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLookup Function

Status
Not open for further replies.

hirenJ

Programmer
Dec 17, 2001
72
GB

Hey all,

I have a form that contains a CodeID -- However, I want the JobFunction that corresponds to the CodeID to be displayed each time the form loads -- im using the DLookup function -- However -- how can I set the criteria to a txtBox that is on my form ??

DLookup("JobFunction", "RespCodes", "[CodeID = (txtBox?)]")

Is this possible, and what would the syntax be?

Cheers

Hj

:eek:)
 
=DLookup("JobFunction", "RespCodes", "[CodeID]="&[txtBox]&")"

That will work if the CodeID is a number. If it's a string you'll need this:

=DLookup("JobFunction", "RespCodes", "[CodeID]='"&[txtBox]&"')"

HTH Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top