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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SUMs from subreports 1

Status
Not open for further replies.

Neoduder

Technical User
Feb 24, 2003
10
US
Hi all,

I have a report with a total in the footer which uses the SUM function to total up currency fields in the records from the report. I have added a sub report in the report footer which also has currency fields which I would like to add to the total in the page footer. I have no problems in producing a total from the main report but as soon as I try to add the values from the sub report I get error messages. I even get an error message if I try to SUM only the values in the subreport. Any Ideas?

Cheers

Chris
 
Add a field in your sub report with the same record source as the field you want to sum. Set it's 'Running Sum' property to Over All (or Over Group as appropriate). You can set this field to Invisible. You can then apply that value to your total in the footer. "The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
Hi,

Nope. Still not working. Even if I only have one record in the sub report and try to sum that value to the footer of the main report it shows as #Error.

The Code I am using for the total is ...

= Sum ( [Cost] ) + Sum([Cost summary on 1 tech subreport].Report!Cost)

The first Sum is the sum of the cost fields in the main report and the second Sum is the sum of the cost fields in the sub report. I even get an error if I reduce the code to...

= Sum([Cost summary on 1 tech subreport].Report!Cost)

Which should just sum the values from the subreport and ignore the main report values.

Thanx in advance for any advice.

Chris

 
It looks to me like you're trying to sum the sum. Try it simple first. If your running sum in the sub report is working correctly you should be able to get that into the footer

= subReport.Report!RunningSumField

Once you get that working you should be good to go. "The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
It Works !!!!

Thanx. It seems it was my own stupidity. I was trying to do the sum in the page footer instead of the report footer. DOH!.

Cheers for your help.

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top