Grand totals in reports


J

Jerry Anderson

I have a report, which correctly displays the total of the items in it.
This report has a subreport, which also correctly totals the items.
How do I get a grand total of both the main and sub reports to print?
 
Ad

Advertisements

A

Allen Browne

This is a 2-step process:

a) Get the subreport totals back onto the main report. See:
Bring the total from a subreport onto a main report
at:
http://allenbrowne.com/casu-18.html

b) Use a running sum to collect the totals throughout the report.
Set the Running Sum property of this text box to Over All.
You probably want to set Visible to No, so you don't see the accumulating
total on the main report.

Now in the Report Footer section, add a text box to show the accumulated
total. Its Control Source will be:
=[txt1]
where txt1 represents the name of the hidden text box that accumulates the
totals.
 
R

Robbie Doo

Allen, I followed your advice but all I'm getting are 0's for the totals.
My control source is something like this on the main form's Report Footer
section:

=subreport.report.text16

Any other suggestions?

Allen Browne said:
This is a 2-step process:

a) Get the subreport totals back onto the main report. See:
Bring the total from a subreport onto a main report
at:
http://allenbrowne.com/casu-18.html

b) Use a running sum to collect the totals throughout the report.
Set the Running Sum property of this text box to Over All.
You probably want to set Visible to No, so you don't see the accumulating
total on the main report.

Now in the Report Footer section, add a text box to show the accumulated
total. Its Control Source will be:
=[txt1]
where txt1 represents the name of the hidden text box that accumulates the
totals.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Jerry Anderson said:
I have a report, which correctly displays the total of the items in it.
This report has a subreport, which also correctly totals the items.
How do I get a grand total of both the main and sub reports to print?
 
A

Allen Browne

Looks like you have not used the HasData and Nz() suggested in the article.

As stated, this is a 2-stage problem. First you need to get the totals
returning correctly. You can then get the running sum working. One step at a
time.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Robbie Doo said:
Allen, I followed your advice but all I'm getting are 0's for the totals.
My control source is something like this on the main form's Report Footer
section:

=subreport.report.text16

Any other suggestions?

Allen Browne said:
This is a 2-step process:

a) Get the subreport totals back onto the main report. See:
Bring the total from a subreport onto a main report
at:
http://allenbrowne.com/casu-18.html

b) Use a running sum to collect the totals throughout the report.
Set the Running Sum property of this text box to Over All.
You probably want to set Visible to No, so you don't see the accumulating
total on the main report.

Now in the Report Footer section, add a text box to show the accumulated
total. Its Control Source will be:
=[txt1]
where txt1 represents the name of the hidden text box that accumulates
the
totals.

message
I have a report, which correctly displays the total of the items in it.
This report has a subreport, which also correctly totals the items.
How do I get a grand total of both the main and sub reports to print?
 
R

Robbie Doo

I think the problem is my master/child linkage between the Main and Sub
Reports. When I change the linkage the report gets distorted. I just don't
know how to resolve the linkage problem without messing up my report.

Allen Browne said:
Looks like you have not used the HasData and Nz() suggested in the article.

As stated, this is a 2-stage problem. First you need to get the totals
returning correctly. You can then get the running sum working. One step at a
time.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Robbie Doo said:
Allen, I followed your advice but all I'm getting are 0's for the totals.
My control source is something like this on the main form's Report Footer
section:

=subreport.report.text16

Any other suggestions?

Allen Browne said:
This is a 2-step process:

a) Get the subreport totals back onto the main report. See:
Bring the total from a subreport onto a main report
at:
http://allenbrowne.com/casu-18.html

b) Use a running sum to collect the totals throughout the report.
Set the Running Sum property of this text box to Over All.
You probably want to set Visible to No, so you don't see the accumulating
total on the main report.

Now in the Report Footer section, add a text box to show the accumulated
total. Its Control Source will be:
=[txt1]
where txt1 represents the name of the hidden text box that accumulates
the
totals.

message
I have a report, which correctly displays the total of the items in it.
This report has a subreport, which also correctly totals the items.
How do I get a grand total of both the main and sub reports to print?
 
A

Allen Browne

Okay. I'm not sure I can help then.

If the linkage between the main report and subreport is not right, the
subreport won't show the right total each time it is called from the main
report, so accumulating the total won't be useful.
 
Ad

Advertisements

R

Robbie Doo

That's OK, Allen. I figured it out. Now everything looks great.
 

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