DLOOKUP confusion

colinmunnelly

Registered User.
Local time
Today, 00:42
Joined
Feb 26, 2002
Messages
89
i have a report based on a query called cnt1. I have palced a parameter in the query asking the user to name a contractor. What i need to do is place information concerning that contractors address details in several text boxes on the report. This information is in another table called CompanyTable. I am trying to use the Dlookup function and having a difficult time trying to understand the function. I think it should be:

=DLOOKUP("AddressLine1","Companytable","Addressline1 = Company)

Company being the field that is from the original query. Hope i you understand.

Col
 
Assuming that these are all text fields, and that AddressLine1 is the field in CompanyTable and Company is the parameter:
DLookup("[AddressLine1]","[CompanyTable]","[AddressLine1] = '" & [Company] & "'")

should work (note the single quotes). I haven't tried Dlookup with a parameter query recently, you may have better luck making a popup form with a combo box to choose the contractor from. You could put the address information in a hidden column of the combo and eliminate the need for Dlookup altogether.
 

Users who are viewing this thread

Back
Top Bottom