Subreports and Reports

  • Thread starter Thread starter Luis
  • Start date Start date
L

Luis

Hi:

Can we add subreports and reports totals together...I
posted a previous request and I have looked through
previous postings and I cannot find anything thta can
help me...I would like to know if ti can be done and
which function to use...I have used the sum function, but
it adds the report total only...when I add the subtotal
sum it gives me #name?...

Thanks a lot for your help...I Hope to be as good as you
guys one day...
 
Luis said:
Can we add subreports and reports totals together...I
posted a previous request and I have looked through
previous postings and I cannot find anything thta can
help me...I would like to know if ti can be done and
which function to use...I have used the sum function, but
it adds the report total only...when I add the subtotal
sum it gives me #name?...


The aggregate functions (Count, Sum, etc) only operate on
fields in the record source table/query. They are unaware
of controls on the report and are even less aware of the
controls within a subreport.

With that in mind, use a text box in the subreport's footer
section to sum the subreport's data. E.g. Let's say the
subreport footer has a textbox named txtTotalCost with the
expression =Sum(Cost)

Then, a main report text box named txtSubCost can refer to
that value by using the expression
=subreportcontrol.REPORT.txtTotalCost
and that can then be added to another value using another
text box with an expression like =Shipping + txtSubCost

Or, you can set the txtSubCost text box's RunningSum
property to Over All so a main report footer text box can
display the total of all the subreports with this expression
=txtSubCost
 
Back
Top