Total Calculation on Form does not work

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a Total control (text box) in the Form Footer that contains the following calculation
=sum([ChargeAmount]
When an additional line tiem (charge) is added to the detail section of the form, the total in the form footer does not recalculate. What to I need to do to get the total to recalculate

Many thanks in advance for your help

-Bar
 
I just tried it to verify it and it did recalculate once the new record was saved. Just
filling in the field and going to the next field in the record didn't do it.

--
Wayne Morgan
Microsoft Access MVP


BarbM said:
I have a form with a Total control (text box) in the Form Footer that contains the following calculation:
=sum([ChargeAmount])
When an additional line tiem (charge) is added to the detail section of the form, the
total in the form footer does not recalculate. What to I need to do to get the total to
recalculate?
 
Experimenting more in the application, I determined that the total will not recalculate until I insert a new record or move to the next record. What I would like to have happen is to have the total recalculate after the amount field is updated. Any suggestions on how this could be achieved programatically

-Barb
 
I can think of a couple of ways to fudge my way through it, but they don't look very good.
I'll have to think about it for awhile. The problem is that you are summing the values in
the field from the form's record source, the data isn't in the record source until it is
saved.

--
Wayne Morgan
Microsoft Access MVP


BarbM said:
Experimenting more in the application, I determined that the total will not recalculate
until I insert a new record or move to the next record. What I would like to have happen
is to have the total recalculate after the amount field is updated. Any suggestions on
how this could be achieved programatically?
 
At the moment, the only thing I can come up with is to do this in the
AfterUpdate event of the textbox you type into and the OnCurrent event of
the form instead of the calculated textbox having the equation in its
Control Source.

You would use DSum to get the sum of the field. You would then check to see
if the Value and OldValue of the textbox you typed into are the same. If
they aren't, subtract the OldValue and add the Value to the DSum result.
Assign this value to the "calculated" textbox.

--
Wayne Morgan
Microsoft Access MVP


BarbM said:
Experimenting more in the application, I determined that the total will
not recalculate until I insert a new record or move to the next record.
What I would like to have happen is to have the total recalculate after the
amount field is updated. Any suggestions on how this could be achieved
programatically?
 
Back
Top