View Full Version : Running Total


Susan Jayne
07-04-2001, 02:51 AM
Hi, I have been stumped by a problem - I'm sure someone will have an easy answer.

I have a Form with a subform the subform contains upto 4 items of expenditure and/or mileage expenses
The main form has a Total Expenses text box containing the following :
=[Expense Reports Subform].[Form]![Expense Totals]+[Expense Reports Subform].[Form]![Total Mileage]

The text box updates when you move to a new record but I would like it to update when you add a new expenditure in the current record.

I hope I've provided enough detail to enable someone to help.

Thanks in advance.

Rich
07-04-2001, 04:31 AM
Untill you tab out of the control that supplies the amount you are summing you can't do anything, but in the after update of that control you could put Me.Recalc
HTH

pacgoncalves
07-04-2001, 05:43 AM
Hello
1. Your field is just for screen - don't you want the field save the sum?
2. If yes, add one field to the table and one text box (ex. text88)to the form (not the subform).
Add another field (ex. text99)to the subform. Text99=Expense Reports Subform].[Form]![Expense Totals]+[Expense Reports Subform].[Form]![Total Mileage]
3. In the events os Text99 put in the onfocus : Text88=Text99

I believe it works

Susan Jayne
07-04-2001, 05:58 AM
Thanks so much for such quick replies. I have managed to overcome the problem by inserting a 'Save Record' button which recalculates the totals. (It also seems to make people feel better when they have actually physically saved a record)

I'm sure I'll be back again with more queries before long so, speak to you soon.