Accessing sub report from main report

  • Thread starter Thread starter box2003
  • Start date Start date
B

box2003

I have been trying to access a control on a sub report using the following
info, though it does not seem to be working. The sub report control is
txtEmployeeSeniority. All I get in the control on my Main Report control
that I am trying to populate, txtServiceYears, is #Name#. I have included
the below information about both reports. When I fire off the Main Report,
one of several sub reports also fire off. I am attempting to bring the
control
value of the identified sub report into the desired field on my main report.

Main Report: rptCompanyData
Main Report Control: txtServiceYears
Sub Report: rptEmployeeInfo_sub
Sub Report Control: txtEmployeeSeniority

Reports!rptCompanyData!Report!rptEmployeeInfo_sub!txtEmployeeSeniority

What am I doing wrong?

Thanks.
 
The subreport IS a control on the main report. This subreport control may or
may not have the same name as the subreport.
=rptEmployeeInfo_Sub.Report!txtEmployeeSeniority
This assumes the subreport and subreport control have the same name. The
subreport control and the text box on the main report should be in the same
section of the main report.
 
Both are located in the same section, report footer. And based on your
response, I have determine the problem. The sub report, as a control on the
main report, has a name of Child33 and that is where my problem orignates.
I was not properly referencing the control name, should be:

=Child33.Report!txtEmployeeSeniority.

Thank you, everything is working correctly now.
 
Back
Top