• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

How to access data in a sub-report

I have a Report that uses a sub-report. Nothing fancy there. However I want to display one of the calculated values from the sub-report in the main report.

Getting the calculated value on a text box in the sub-report was no problem, but I have a hard time finding the syntax to access the value.

Thanks for any help.
0
altena
Asked:
altena
1 Solution
 
BrianWrenCommented:
The way to access controls on sub reports is as follows.  From the main report, if the sub report control is named SubRpt, (regardless of the name of the form object that is in the sub report control), and the name of the textbox on the subreport is txtName, its value is:

   Me!SubRpt.Form!txtName

From elsewhere, where you need to specifically name the main report whith the sub report on it, (say the main report is named 'frmBody'):

   Forms!frmBody!SubRpt.Form!txtName

or

   Forms("frmBody")!SubRpt.Form!txtName

Brian
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now