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!

How do I refer to a table field from a report? 1

Status
Not open for further replies.

clint6

Technical User
Feb 8, 2007
12
US
I have a report that has a query as a data source. However, I'd like to look up a table field and add it to the report. Does anyone know how to refer to a table field from a query based report without having to add the table field to the query?

Thanks
 
Check out the DLookup function

Let them hate - so long as they fear... Lucius Accius
 
How are ya clint6 . . .

Sample code:
Code:
[blue]= DLookup("[[i]FieldName[/i]]", "[[i]TableName[/i]]", "ID = " & Me!TextboxName)[/blue]

Calvin.gif
See Ya! . . . . . .
 
Thank you all very much. The dlookup function worked within the text box.

I used the following to get my dates from the Input table:
="Period Beginning " & DLookUp("[BEGDATE]","Input") & " Through " & DLookUp("[ENDDATE]","Input")

This was a previously built report from a query with other BEGDATE and ENDDATE fields from different table.

Thanks to all
 
clint6 . . .

BTW: [blue]Welcome to Tek-Tips![/blue] To get great answers and know whats expected of you in the forums be sure to have a look at FAQ219-2884 [thumbsup2]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top