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

Dlookup format

Status
Not open for further replies.

PhoneTech2

Technical User
Aug 12, 2002
16
0
0
US
I have several tables. The key field that links these tables is called device_id.

When I use dlookup in a report I run into a problem.

If I want to display an extension number from table devices I enter a dlookup statement that looks like this:

=dlookup("extension","devices","device_id=device_id)

It does not work.

If I first create a text box: Text1=device_id and then do a lookup:

=dlookup("extension","devices","device_id=text1")

It works. What am I doing wrong?
 
Hi!

Try it like this:

=dlookup("extension","devices","device_id=" & text1)

hth
Jeff Bridgham
bridgham@purdue.edu
 
I am sorry, I must not have made myself clear.

=dlookup("extension","devices","device_id=text1") works.

I just do not want that extra step of creating text1

I want to use the same field name device_id in the criteria.

 
PhoneTech2,

Why not prefix the device_id with the table it comes from?

ie,

=dlookup("extension","devices","tbl1!device_id=tbl2!device_id)

Hope that helps [pipe]
 
It works! Thank you very much. I know there had to be a way, and I just could not figure it out. (All I know about Access is from doing it, and looking at others.) This little trick goes into my refernce book. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top