Delay in getting subform total to calculate

  • Thread starter Thread starter John F
  • Start date Start date
J

John F

I have a continuous subform with each line containing a calculated field,
which was defined in the subform query. The subform footer contains a text
field with the Control Source containing =Sum([linetotal]).

When a text field in a subform line is updated, as soon as focus leaves that
field, the line total immediately reflects the updated line total. But the
subform footer field will only update when a different line in the subform is
selected or when a control in the main form is selected.

Is there a way to have the subform footer field update as soon as a line
total field updates?

Thanks,

John
 
John,
The line calculation has what it needs to make the calculation, but not
the footer calculation.
Even though you've entered some elements of the calculation, that record
has not been written to the table.
So, as far as the footer calc is concerned... it displays correctly for
the recordset it has.
When you move from record to record, Access performs an Update, thereby
giving the footer the new data, and the footer responds correctly..

On whatever control/s you choose, use it's AfterUpdate event to Refresh
the subform.
This would apply to any field/s directly involved in the actual
calculation.
ex: Price * Qty = LineTotal
Both the Price and Qty's AfterUpdate should Refresh the form.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
Back
Top