Sub Report and Report totals question.

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

Guest

I have a report that displays a base salary (which is a calculated field in
my query), then my subreport displays an employee's various supplemental $
(sometimes 0 line items up to 7 supplements). How do I get my report to
display a total salary of all this money? This would have to add the base
salary from the main query/report and then add up all the supplements from
the subquery/subreport.
Thanks.
 
Pearland Data Analyst <Pearland Data
I have a report that displays a base salary (which is a calculated field in
my query), then my subreport displays an employee's various supplemental $
(sometimes 0 line items up to 7 supplements). How do I get my report to
display a total salary of all this money? This would have to add the base
salary from the main query/report and then add up all the supplements from
the subquery/subreport.


The total supplements can be calculated in the subreport's
(invisible?) report footer section by using a text box
(named txtSupTotal) with an expression like:
=Sum([amount])

Then the main report can display that value in a text box in
the same section that contains the subreport by using an
expression:
=IIf(subreport.Report.HasData,subreport.Report.txtSupTotal.0)
 
Thanks for taking the time that I didn't want to Marsh ;-) One small
correction that I have time to make is the last period should be a comma.

=IIf(subreport.Report.HasData,subreport.Report.txtSupTotal,0)

--
Duane Hookom
MS Access MVP

Marshall Barton said:
Pearland Data Analyst <Pearland Data
I have a report that displays a base salary (which is a calculated field
in
my query), then my subreport displays an employee's various supplemental $
(sometimes 0 line items up to 7 supplements). How do I get my report to
display a total salary of all this money? This would have to add the base
salary from the main query/report and then add up all the supplements from
the subquery/subreport.


The total supplements can be calculated in the subreport's
(invisible?) report footer section by using a text box
(named txtSupTotal) with an expression like:
=Sum([amount])

Then the main report can display that value in a text box in
the same section that contains the subreport by using an
expression:
=IIf(subreport.Report.HasData,subreport.Report.txtSupTotal.0)
 
Duane said:
Thanks for taking the time that I didn't want to Marsh ;-) One small
correction that I have time to make is the last period should be a comma.

=IIf(subreport.Report.HasData,subreport.Report.txtSupTotal,0)

That's a period? My eyes are not good enough to make the
distinction ;-)

Thanks for catching that typo.
 
Back
Top