Calculation events?

  • Thread starter Thread starter grep
  • Start date Start date
G

grep

What event gets triggered when a calculated field is updated? How can I
make a bound field recalculate itself based on recalculations that take
place in other fields?

Yes, I know I'm not supposed to store calculated values, but in this
case, some of the base values may change over time, which would change
the calculation the next time I needed to refer to it.

So is there an event I can use?

grep
 
Grep,
A calculated field does not have a "update" event.

However, each of the "entered" items (base values) that go into that
calculation do have AfterUpdates, so they can provide the "calculation has
changed" event you may need.
Given the situation you described in your post, you do not have to save
the calculated value.

ex. Price * Qty = ExtendedPrice (the price may change, so you want to
capture this price today)

Price and Qty are bound to fields in your table. ExtendedPrice is a
calculated field (= Price * ExtendedPrice) and will "display" the
calculated value whenever Price or Qty are entered.
That's all you have to capture. You can always recalculate
ExtendedPrice "on the fly" in reports, forms, and queries with another
calculated field. The Price may change in the future, but you've "captured"
the old price.
hth
Al Camp
 
Back
Top