Running sum in Access 2010 Subform textbox won't roll up numbers

mt1013

New member
Local time
Yesterday, 18:29
Joined
Sep 9, 2015
Messages
2
Hello.

I can't get my dsum function to work in my subform. The numbers are supposed to add/roll up to the previous row. Instead I'm getting a total of the last row, in all the rows, as the rows go down in the form.
The running subtotal is against a percentage field. I did a test in a reqular query and got the results I wanted but in the real world all I get is a zero or total numbers where there should be a roll up of the previous rows.
I tried putting the function in the control source of the text box and I tried writing a sql statement as part of a recordset but again no results. When I put the function in a text box, at least I get some numbers. But If I try to do a VBA procedure with the Dsum function, I just get errors. As well, when I created a SQL statement using the Dsum function, I get the same results .
I'm no sure if its a syntax problem...or.

Can anybody point out how I could adapt these statements or function below to workable VBA Code?

Thanks

Here is the working function when I test it in a select statement:


RunningPayoutBalance: Format(DSum("MaxTierPayout","tbl_curvesourceinput","[TestID] <= " & [DupTestID] & ""),"Fixed")

Here is the working SQL statement from the select query:

SELECT tbl_CurveSourceInput.Test AS DupTest, Format(DSum("MaxTierPayout","tbl_curvesourceinput","[TestID] <= " & [DupTestID] & ""),"Fixed") AS RunningPayoutBalance
FROM tbl_CurveSourceInput
GROUP BY tbl_CurveSourceInput.Test;

 
Thanks!
That was just what I needed.
 

Users who are viewing this thread

Back
Top Bottom