Calculation between two subreports

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

Guest

Here is a question I have not seen before.

I have two subreports on one main report. I want to calculate the difference
between a total on each report.

Report A has a total gallons pumped through a system, each reading is taken
daily and then totaled in the report footer.

Report B has a total gallons pumped through 22 individual wells, reading sa
re taken once a week and the total is calculated in the footer of report B.

In the footer of the Main Report I want to calculate the difference between
those two numbers. here is what I put in the unbound text box:

=([Reports]![Weekly Gallons
Pumped]![text11])-([Reports]![rptMWTotalUsage]![text3])

I get a #Name? error on the report. Any ideas?
 
Hello Larry.

Larry G. said:
Here is a question I have not seen before.

I have two subreports on one main report. I want to calculate the
difference between a total on each report.

Report A has a total gallons pumped through a system, each reading is
taken daily and then totaled in the report footer.

Report B has a total gallons pumped through 22 individual wells,
readings are taken once a week and the total is calculated in the
footer of report B.

In the footer of the Main Report I want to calculate the difference
between those two numbers. here is what I put in the unbound
text box:

=([Reports]![Weekly Gallons
Pumped]![text11])-([Reports]![rptMWTotalUsage]![text3])

I get a #Name? error on the report. Any ideas?

You cannot access a subreport like this, the reports collection only
contains the "main reports" that are open.
The solution depends on how the subreport controls in the main report
are named. If their names are the same as the names of the respective
database objects, try:

=[Weekly Gallons Pumped].Report![text11] -
[rptMWTotalUsage].Report![text3]
 
Thanks Wolfgang that did the trick! Justr when I think I have what I need
figured out, I find a new way to stump myself!
--
Never give up, the answer IS out there, it just takes a while to find it
sometimes!


Wolfgang Kais said:
Hello Larry.

Larry G. said:
Here is a question I have not seen before.

I have two subreports on one main report. I want to calculate the
difference between a total on each report.

Report A has a total gallons pumped through a system, each reading is
taken daily and then totaled in the report footer.

Report B has a total gallons pumped through 22 individual wells,
readings are taken once a week and the total is calculated in the
footer of report B.

In the footer of the Main Report I want to calculate the difference
between those two numbers. here is what I put in the unbound
text box:

=([Reports]![Weekly Gallons
Pumped]![text11])-([Reports]![rptMWTotalUsage]![text3])

I get a #Name? error on the report. Any ideas?

You cannot access a subreport like this, the reports collection only
contains the "main reports" that are open.
The solution depends on how the subreport controls in the main report
are named. If their names are the same as the names of the respective
database objects, try:

=[Weekly Gallons Pumped].Report![text11] -
[rptMWTotalUsage].Report![text3]
 
Back
Top