Is it *really* necessary to have this in the query or would having it in a
report be satisfactory? While this can be done in a query it is complex and
slow. In a report it is a snap and has no performance penalty at all.
The reason is that queries are based on "Sets" of data. There really is no
concept of "the record before this one" or "the record after this one" like
there is in a spreadsheet. This means that you have to run a sub-query for
every row in the main query which is why performance can be really bad.
A report in contrast is rendered sequentially so the ability to do running sums
is built in and easy to do.
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com