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

Running Sum Problem

Status
Not open for further replies.

sqlJunior

Technical User
Joined
Sep 22, 2002
Messages
123
Location
TH

I have a hidden running sum text box called txtRunSum set to -1 and this correctly counts the number of records.

However, I have a problem showing the total of the running sum in the Report Footer.

If I set the Report Footer text box control to =txtRunSum it will only show the running sum total to the top of the report on its last page.

If I set the Report Footer text box control to =Count(txtRunSum) or =Sum(txtRunSum) when I open the report it asks me to 'Enter Parameter Value txtRunSum'

Can anyone help???
 
sqlJunior
If what you want is a count of all the records, then in your report footer put an unbound text box =Count(*).

Tom



 

Thanks for coming back on this Tom.
This is actually a total for a grouped item and consequently =Count(*) will total all the records in the group sub-group as well so I ca.nt use it.

sqlJunior
 
sqlJunior
I'm a little confused (or just thick this morning). Can you outline just exactly what it is you want.

If I understand correctly, you have several groups. At the end of the report what is it you want to total?

By the way, is there a particular reason for setting the txtRunningSum to -1 rather than 1?

I have to be away for a couple of hours. I'll check this again when I come back.

Tom

 

Sorry Tom, the -1 was a typo. txtRunSum is set to =1.

I have found out why =txtRunSum in the Report Footer only showed the running sum total to the top of the report on its last page. I referenced the Report Footer running sum total (called txtRunSumTot and set as =txtRunSum) from a text box in the Report Header (set as =txtRunSumTot). This was just to display the total in the header but it seems to force the footer text box(txtRunSumTot) to only count as far as the top of the page. Anyway, by removing this header reference txtRunSumTot now correctly counts to the bottom of the report.

This still leaves my last problem - why can't I count or sum the running sum text box as =Count(txtRunSum) in the Report Footer.

The background is that I have a list of drawing numbers and these each have revisions which show in the report details section. To enable a separate count of the drawing numbers alone I have set the drawing number as a group header. I then do the running sum on the drawing number to total it and thats the text box I call txtRunSum (set as =1).

Shouldn't I now be able to sum and count txtRunSum?

sqlJunior
 
You can't do a Sum or Count on a calculated control which is what txtRunSum is. If you just use the expression
=txtRunSum, it will return the last value for txtRunSum which is all you should need.


Paul
 
OK Thanks Paul

SqlJunior
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top