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

DLookup issue

Status
Not open for further replies.

aquinox

Programmer
Jul 2, 2007
38
AU
Hi,

I got a problem with DLookup. I'm using Access 2003.

Here is the code

In the form, i have a combo-box that has a list of towns.

the following is the code that i put in the control-Source of a textbox that shows the result of DLookup.

In the control-source,
=DLookup("MaryTime","Locations","Location" = Forms![Pump Stations]!Location)

This returned nothing.

MaryTime is of type "Text"
Location (of Locations table) is of type "Text"

But when i put this into SQL query, it returns the value of MaryTime.

Look forward to hearing from you.

Thank you
 
You may try this:
Code:
=DLookup("MaryTime","Locations","Location='" & Forms![Pump Stations]!Location & "'")
or this:
Code:
=DLookup("MaryTime","Locations","Location=Forms![Pump Stations]!Location")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top