Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totaling SubReports 1

Status
Not open for further replies.

sandora

Technical User
May 17, 2005
57
US
I have 4 subreports in one main report. The subs are summaries for different companies and contain totals for each. I need to total all of the subs for a grand total. Can this be done and if so, how?
 
Sorry, I'm using ver XI and an AccessDB.
 
Create Shared variables in the subreports and store the values that you want to accumulate.
e.g.
In subreport 1
@Store the vars
Shared NumberVar sub1_gt := Sum({YourField});

In subreport 2
@Store the vars
Shared NumberVar sub2_gt := Sum({YourField});

etc. for the other subreports.

In the main report, add these values together.

e.g.
In Main report (in a section that occurs after the subreport fires)
Code:
@Accumulate
Shared Numbervar sub1_gt;
Shared Numbervar sub2_gt;
Shared Numbervar sub3_gt;
Shared Numbervar sub4_gt;
sub1_gt + sub2_gt + sub3_gt + sub4_gt


Bob Suruncle
 
I've named the formula (fieldname shared) and used this:

Shared NumberVar sub1_comamt:= Sum ({@Commission Amount});

it gives me an error that a number is required here and highlights after the =. I tried it on each Sum and it gives the same error. Also I have 8 totals in each report. Can I make one formula for all or do they have to be separate formulas?
 
I figured out the number thing, it is currency, and CurrencyVar seems to work with that part.
 
I just want to thank everyone on this sight who helps with these problems. I've learned so much in the last month and you've made me look really good. I actually got this thing to work. Again, thanks so much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top