Doing a DLookup in a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In a form if I wanted to lookup a value of a field which was not tied to the
table on the report I would use a DLookup. Is there an equalivant on a
report?

Also since there are very few events, where would I tie something like this?

Thank you again for all of your help.
 
Use DLookup() in the control source of the text box, e.g.:
=DLookup("Field1", "Table1")

If it really does need code to look up the value and assign it to an unbound
text box, use the Format event of the section that contains the text box.
 
Allen,

I am a wee bit confused. The report does not have any text boxes. I am
just attempting to be able to get a value from another table which is not
part of the select statement for the report (similar to the DLookup in a
form). This is my report

From the sad table:
Cust, Number, Item Number

From the Customer Table
Name

I want the Customer Name which corresponds with the cust from the sad table.
Cust from the sad table is in the header and not repeated. So the report
would look like:

Cust Name
Number Item Number
Number Item Number
etc.

Does this make sense (it is late, so I just want to make sure).

Thanks,
 
Open the report in design view.
Do you see any boxes on the report where the Cust field will display?
These are text boxes.
Right click them, and choose Properies.
On the Data tab is the Control Source.
That's where the expression goes.
 
Back
Top