Sub Report and Report totals question.

  • Thread starter Pearland Data Analyst
  • Start date
P

Pearland Data Analyst

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.
 
M

Marshall Barton

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)
 
D

Duane Hookom

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)
 
M

Marshall Barton

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.
 

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

Top