Sub-Report Totals printing on the Parent

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report in Access 2003 that has a sub-report. The sub-report totals
off a table different than the parent. I want to move that total (Field
Name: Text12) to the parent to be able to add it to another field. What is
the correct way to reference the total in the sub-report on the parent? What
property in the Text Field on the parent would I place this "link" to pull
the total from the sub-report?

Thx-J
 
J said:
I have a report in Access 2003 that has a sub-report. The sub-report totals
off a table different than the parent. I want to move that total (Field
Name: Text12) to the parent to be able to add it to another field. What is
the correct way to reference the total in the sub-report on the parent? What
property in the Text Field on the parent would I place this "link" to pull
the total from the sub-report?


The subreport must do the calculation in either its
Report Header or Footer section.

You can display the subreport's total on the main report by
using a text box in the same section as that contains the
subreport. The text box ControlSource expression can be as
simple as:
=subreport.Report.Text12
But, if there is any chance that a subrepo might not have
any records, that expression can result in #Error. To avoid
that and displau a 0 in that case, use this indtead:
=IIf(subreport.Report.HasData, subreport.Report.Text12, 0)
 
Hey Marshall:

When I go to the main form, add a control I type the following code in that
text control:

=rpt_Expense Report-SUB.Report.Text12

Where the subreport is called rpt_Expense Report-SUB. I did make sure the
control is created in the same footer the sub form is located. But Access
responses with:

The expression you entered contains invalid syntax. You may have entered an
operand without an operator. Any ideas on what the correct syntax should be?
 
A syntax requirement throughout Access is that any name that
contains a space or other funky character must be enclosed
in [ ]

=[rpt_Expense Report-SUB].Report.Text12
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top