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!

Using Dlookup in a query 1

Status
Not open for further replies.

Eightball3

Programmer
Nov 23, 2002
138
US
I am trying to construct a query where one of the fields is a looked up value based on the value of a field in the query. I am having trouble referring to the fiel in the Dlookup statement. Here is what I have..that isn't working [neutral].

Model: DLookUp("[model]","inventory","[file number] = [queries].[service by model].[file number]")

Service by Model is the name of the query.

Any help would be appreciated.
 
try

Model: DLookUp("model","inventory","[file number] = " & [file number])

assuming the field in your query is called [file number] and is numeric.

this is 'parsing' your statement, so it will fead the field [file number] as a number.
 
Thanks Ginger for the reply.

File Number is a text field. It is a field name in two tables; Inventory, and Standards Service. What I want is the Dlookup to pull out the Model info from the Inventory table. The File Number field is common to both tables.

Thanks.
 
since it's text, you have to make it so Access reads that there are quotes around it:

try

Model: DLookUp("model","inventory","[file number] = '" & [file number] & "'")

that's: where File Number = single quote, double quote & blah & double-quote, single-quote, double-quote. ok?

it comes out:

...where [file number] = 'Blah'

 
Thanks Ginger that worked!! Have a star for your trouble!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top