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!

dLookup in Subreport UNSUCCESSFUL compared to use in Report

Status
Not open for further replies.

sanders720

Programmer
Aug 2, 2001
421
US
=DLookUp("[Customer]","[Customer]","[Customer ID] = '" & [Reports]![rptInquiryInfo]![CustomerID] & "' ")

This recordsource command works great in my report, but produces errors in the sub report.

Any thoughts?

Thankyou in advance for the help...
 
You may need to specifically reference the subreport control name. Is "rptInquiryInfo" the name of your report or your subreport? Is this expression on the report or the subreport?

You tend to need to be very specific so Access knows where that "CustomerID" guy is...

78.5% of all statistics are made up on the spot.
Another free Access forum:
More Access stuff at
 
The control name is the same, for it is the same report! There is a source object property called Report.rptInquiryInfo.

The report that the sub report exists in is called rptQuotesInfo. Do I need to do something differently in my dlookup statement below? Remember, it works great in the report by itself.


=DLookUp("[Customer]","[Customer]","[Customer ID] = '" & [Reports]![rptInquiryInfo]![CustomerID] & "' ")

Thanks again...
 
If the syntax is anything like what you need in a form/subform arrangement, try

=Dlookup("[Customer]", "[Customer]", "[Customer]![CustomerID] = '" &
Reports!rptQuotesInfo!rptInquiryInfo.Report![CustomerID] & "'")

78.5% of all statistics are made up on the spot.
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top