Calculated fill referring to subreport

G

Guest

Hi

I have a field in a subreport details section called Company_Pledge. Also in the subreport is a details footer with the calculated field =Sum [Company_Pledge] which gives me the total of the company pledges for all the companies listed. The main report has the Lead company. When I review the main report it lists the lead company at the top of each section with multiple subcompanies underneath (the subreport) adding their total pledge amounts. I would like to put in the main report footer a calculated field that totals all the company pledges for all the companies listed under all the lead companies. I have tried to use the same formula as above, but nothing appears. I think I may have to refer to the subreport in which the field is contained as follows: =Sum([RptsubAdLog].[Company_Pledge]). with RptsubAdLog being the name of the subreport, but this also does not work. I have been searching help and cannot find the answer to this. Can someone help me out with this. Thank you

Dorothy
 
D

Duane Hookom

You can create a new text box in the lead company footer on the main report
that references the total in the subreport. Name the text box txtBigTotal
and set its running sum to Over All. Then add a text box to the report
footer with a control source of: =txtBigTotal

--
Duane Hookom
MS Access MVP


Dorothy said:
Hi,

I have a field in a subreport details section called Company_Pledge. Also
in the subreport is a details footer with the calculated field =Sum
[Company_Pledge] which gives me the total of the company pledges for all the
companies listed. The main report has the Lead company. When I review the
main report it lists the lead company at the top of each section with
multiple subcompanies underneath (the subreport) adding their total pledge
amounts. I would like to put in the main report footer a calculated field
that totals all the company pledges for all the companies listed under all
the lead companies. I have tried to use the same formula as above, but
nothing appears. I think I may have to refer to the subreport in which the
field is contained as follows: =Sum([RptsubAdLog].[Company_Pledge]). with
RptsubAdLog being the name of the subreport, but this also does not work. I
have been searching help and cannot find the answer to this. Can someone
help me out with this. Thank you.
 
M

Marshall Barton

Dorothy said:
I have a field in a subreport details section
called Company_Pledge. Also in the subreport
is a details footer with the calculated field
=Sum [Company_Pledge] which gives me
the total of the company pledges for all the
companies listed. The main report has the
Lead company. When I review the main report
it lists the lead company at the top of each
section with multiple subcompanies underneath
(the subreport) adding their total pledge amounts.

I would like to put in the main report footer a
calculated field that totals all the company
pledges for all the companies listed under all the
lead companies. I have tried to use the same
formula as above, but nothing appears. I think I
may have to refer to the subreport in which the
field is contained as follows: \
=Sum([RptsubAdLog].[Company_Pledge]). with
RptsubAdLog being the name of the subreport,
but this also does not work.

Your right that you need to refer to the total on the
subreport, but as you've seen, you can not Sum values in
controls. Instead, add a text box named txtRunPledges to
the detail section of the main report. Set this text box's
RunningSum property to Over All and set its control source
expression to:

=IIf(subrpt.Report.HasDate, subrpt.Report.totaltextbox, 0)

where subrpt is the name of the subreport control on the
main report and totaltextbox is the name of the text box in
the subreport's footer section.

Now, add a text box to the main report's footer section with
the expression =txtRunPledges
 

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