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

CUMULATIVE SUM IN DETAIL SECTION 2

Status
Not open for further replies.

jadams0173

Technical User
Feb 18, 2005
1,210
I have a column in report that I've been asked to show a cumulative sum for. I've not worked with reports that much. Is there a way to do this. Here is what I'm looking for. I've thought of trying to add another column in my table to bind to the cumdata text box but was hoping it could be calculated without having to do that

Data CumData
1 1
3 4
5 9
15 24

I'm going to do more searches in this forum but so far all I've found is running sums and post about Over all and Over group.
 
Your second field (running sum) will have the same control source as your first field, but the running sum property should be set to "Over All
 
Thanks for the reply. When I do that I get the exact same values in both columns.
 
Here is the sql that builds the table the report is bound to. I'm trying to cumsum the picksrequired field

Code:
sql = "SELECT tblReleased.MO_NUMBER, tblReleased.MOTYPE, tblReleased.ORDER_QTY, tblReleased.ITEM, tblReleased.FEEDERTOTAL, [red]tblReleased.WH_PICKS1 AS PicksRequired[/red], tblReleased.TotalPicks, tblReleased.TotalFeedersNeeded, tblReleased.relDate, tblReleased.lines, tblReleased.reltime, tblReleased.PRIORITY, tblReleased.COMMENT, IIf(IsNull([PicklistComplete]),'N','Y') AS DISB, IIf(IsNull([CountOfCOMPONENT]),0,[COUNTOFCOMPONENT]) AS SMKTPARTS " _
    & "INTO " & TempReport _
    & " FROM (TBLDISBURSED_MOS RIGHT JOIN tblReleased ON TBLDISBURSED_MOS.OrderID = tblReleased.MO_NUMBER) LEFT JOIN TBLSUPERMARKET ON tblReleased.ITEM = TBLSUPERMARKET.PARENT " _
    & "GROUP BY tblReleased.MO_NUMBER, tblReleased.MOTYPE, tblReleased.ORDER_QTY, tblReleased.ITEM, tblReleased.FEEDERTOTAL, tblReleased.WH_PICKS1, tblReleased.TotalPicks, tblReleased.TotalFeedersNeeded, tblReleased.relDate, tblReleased.lines, tblReleased.reltime, tblReleased.PRIORITY, tblReleased.COMMENT, IIf(IsNull([PicklistComplete]),'N','Y'), IIf(IsNull([CountOfCOMPONENT]),0,[COUNTOFCOMPONENT]) " _
    & "HAVING (((tblReleased.relDATE) = #" & RelDate & "#)) " _
    & "ORDER BY tblReleased.PRIORITY"

DoCmd.RunSQL sql
 
This may sound like a silly question, but did you put the field in the Detail section of your report? Also, do you have any grouping setup on your report?
 
I do have the field in the detail section of the report. The grouping is by PRIORITY ASC and then RELTIME ASC.

group header=no
group footer=no
group on=each value
group interval=1
keep together=no

for both groups.

 
And you set the Running Sum property of the 2nd textbox to "Over All"? Try setting it to "Over Group" to see if that makes a difference. This should work...I setup a simple example like the one in your original post, and it worked.
 
I still get the same value in both text boxes. My report has 12 total text boxes on it that are bound to the table. The only DSum are in the footer. I hope my oversimplified OP wasn't misleading.
 
Is it possible that the field you want the running sum on is text? If so, try:
=Val([FieldName])
 
Thanks Remou. That was it.

Many thanks to you also rjoubert. Both of you enjoy the stars!!!! [2thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top