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

Using two tables for record source on report

Status
Not open for further replies.

ProgramError

Programmer
Mar 2, 2005
1,027
GB
Hi folks

I have a report which uses a main table for its record source. Also on the roport I have a textbox which has the following code for its record source (looking at a different table).

Code:
=DLookUp("[NoTapes]","tblrecycled",[deptcode])

Using this coding the result returned shows me the first record in the 'tblrecycled' table. what I want it to do, is find the matching 'deptcode' record in the table. I suspect it has something to do with the [deptode] part of this but I'm not sure how to resolve it.

Program Error
Programmers do it one finger at a time!
 
=DLookUp("[NoTapes]","tblrecycled","[deptcode]= " & [deptcode])

This says Lookup the value of NoTapes in table tblrecycled where the field [deptcode] is equal to the [deptcode] field on my report. You may have to adjust the syntax if [deptcode] is a text field. I have it as a number right now.

Paul
 
Sorry Paul it didn't work. Thank's anyway. It's set me off in the right direction though.


Program Error
Programmers do it one finger at a time!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top