Running Sum in a query.

J

John Baker

Is it possible to created a calculated field in a query which would be the
running sum of another field?

I have created a text box on a report to have the running sum and now need a
similar effect on a form. I have a subform and each detail line contains a
debit amount and a credit amount . I would like to show the current balance
for each of the lines. This of course is simple to do in excel but not so
easy in Access. If I can't get an easy solution then I guess I will resort
to DAO.

Any help greatly appreciated.
John B
 
M

[MVP] S.Clark

In the subform's Detail section, have a textbox that adds the Credits to the
Debits. (e.g. txtBalance=txtCredit + txtDebit)

In the subform's Form Footer section, have a textbox that sums the field in
the Detail section. (e.g.txtSumBalance =Sum(txtBalance))

On the mainform, have a textbox refer to the summary field txtbox.
(e.g. txtsfrmBalance = Me!subformname.form!txtSumBalance)
 
J

John Baker

Thanks for your reply Steve

I was actually looking for a running sum of the balance on the form and not
just a final balance at the end.
Any further help would greatly appreciated.

John B
 
M

[MVP] S.Clark

You would have to calculate it constantly. Everytime the data had an
addition, deletion, sort, or filter. Way to much hassle, IMO.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top