Update value on the main form with the value on a subform

B

Brandon

Hi,
I have a calculated control on a subform. It is in the footer of the
subform and CS = Sum([ForecastSavings]). It is not bound to any field in a
table, it is for display purposes on the subform.
However every time the calculated text box changes, I would like to update
the project savings field on the main form. I have done this successfully on
the project unload event, but I can't figure out what event procedure (if
any) happens when the calculated text box value changes.

My code is below and is in the main form unload event.

Dim intTotalForecast As Currency
Dim intProjectHeaderForecast As Currency

intTotalForecast = Forms!_ sfrmProjectBreakout.txtForecastTotal.Value
intProjectHeaderForecast = Forms!_ frmProjectEntry.ForecastSavings.Value

If intTotalForecast <> intProjectHeaderForecast Then
Forms!frmProjectEntry.ForecastSavings.Value = intTotalForecast
End If
It works great, but I need to figure out which event can update the text box
before the user closes the form. Thanks in advance!
 
Top