View Full Version : RUNNING TOTAL ON QUERY OR FORM


Bernie Benedicto
03-20-2001, 04:43 PM
I have a report that has a running total (Running Sum) but now I need to be able to query the same table and specify a condition (like >75%)based on the running total (which is not in the table)

Is there no equivalent of the running total or running sum control for queries or forms. How come only reports have this feature?

Pat Hartman
03-20-2001, 06:18 PM
Only reports have this feature because only reports use a "fixed" recordset. Queries and forms use a "live" recordset. Their recordsets are "connected" to the underlying tables which might be updated while the recordset is open. Plus they have to support forward and backward scrolling. Since the current row in a "live" recordset keeps changing, trying to keep running sums is problematic.

Your best bet is a function that reads the table, calculates the running sum, and writes the output to a temp table. Once you have determined the total for the recordset, you can then write an update query to calculate the percent. Then run your select query against the temp table.

Bernie Benedicto
03-20-2001, 09:19 PM
That sure explains it. Thanks.

Cosmos75
09-18-2002, 11:29 AM
Running Total / Sum in a query using Select not DSum
http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=31806&perpage=15&pagenumber=1

You will have to read the entire thread to find JonK's Select statement to do Running Totals / Sum in a query.

Hope this helps!
:D