Storing data via calculated control on a form

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
 
J

JohnFol

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top