Storing data via calculated control on a form

  • Thread starter Thread starter Stefan J
  • Start date Start date
S

Stefan J

In a form I have a calculated control, and I want to store
the resulting value in a table. The form's datasource is a
table which contains the field where I want the value to
go.

I would appreciate a little help from you out there!

Stefan
 
First of all, if the calculation uses fields in the same record, don't store
the calculated value, just derive it whenever you pull back the data.

If you still need to do it, add the calculated field to the form as a hidden
text box. On the BeforeUpdate, set the texst box to be the calculation,

ie
Private Sub Form_BeforeUpdate(Cancel As Integer)
me.txtCalculatedValue.Value = me.txtQty.Value * me.txtCost.Value
End Sub
 
Back
Top