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

Running Sum of Last Values 1

Status
Not open for further replies.

barbola

Technical User
Feb 27, 2003
1,132
CA
I have a report for YTD earnings and the Year footer has Last(YTD).

I want a total in the Pay Code footer that totals all the Last(YTD) values.

I can't get it to work. I tried several different ways of using Running Sums.

thanks.

Thanks!
Barb E.
 
Could you provide some field names and control source expressions as well as report grouping? It sounds like you have YTD and Paycode footers but we can't see your report from our vantage point. I generally avoid anything in Access that involves "Last".

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Here is what the report looks like:

Employee
PayCode1 CUR YTD
Year1
Per1 100 100
Per2 100 200
Per3 100 300
Year1Total 300 300 =last(YTD)
Year2
Per1 100 100
Per2 100 200
Year2Total 200 200

PayCodeTotal 500 500

I can get the CUR Paycode Total to calculate as it is just a running sum. I cannot get the YTD Paycode total to work.

thanks.



Thanks!
Barb E.
 
The Year1Total doesn't need to use Last(). You should be able to simply use a control source of:
[YTD]
Set the running sum of this text box (assume its name is txtYTDRS) to Over All or Over Group.
Then in your PayCodeTotal footer, add a text box with a control source of:
=[txtYTDRS]


Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
I swear I tried that and it didn't work.

Well it works now so I thank you very much!



Thanks!
Barb E.
 
and I swear it worked that one time and now it does not work. It only gives me the last amount.

Detail section has a field for YTD_UNITS

Year footer has field txtYTDUNITS =[YTD_UNITS] (OverGroup)

PayCode footer has field text63 =[txtYTDUNITS]

I cannot get the PayCode to be the sum of each year's final total. Year1 = 300, year2 = 200 and the PayCode total is giving me 200 instead of 500.

Thanks!
Barb E.
 
I lied. It is working for the PayCode footer total, but Year2 total is a running sum, showing 500 instead of 200.

Employee
PayCode1 CUR YTD
Year1
Per1 100 100
Per2 100 200
Per3 100 300
Year1Total 300 300 =last(YTD)
Year2
Per1 100 100
Per2 100 200
Year2Total 200 200 (showing 500)

PayCodeTotal 500 500


Thanks!
Barb E.
 
Make the Year2Total invisible so you don't see the 500. The running sum total is not meant to be seen. If you want a group sum, then use a simple sum().

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Good enough for me. I'll hide it.

thanks!

Thanks!
Barb E.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top