Saving value from an unbound textbox

david444

Registered User.
Local time
Today, 21:47
Joined
Mar 11, 2003
Messages
12
I have a form which has an unbound text box on it. The unbound textbox calculates a total from two others fields on the same form. I need to know how to save the value calculated by the unbound textbox into a field of the source table of the form.
 
david,
You should not store calculated fields unless you have very good reasons for it. At the moment I can't think of one right now :) .

You might get problems with data concistency.

However if you must......

Set your StoreField to the Calculated value, something like this:

Forms!YourFormNameHere!YourControlName=CalculatedControl

where ControlName is a field on the form which should store the value in the underlying table.

The best thing to do would do the calculation when you need it.

hth
Gerhard
 
I agree with geralf. It is almost certain that you do not need to store the calculation. You can do the same calculation in a query so that it is available whenever you need it to be. That way, you don't have to worry about any of the fields involved in the calculation being changed and the calculation not being re-done.

However, to save a calculated value to a table column does not require that the bound column appear on the form as a control. It simply requires that the column be present in the Form's recordsource.

Me.YourFieldName = Me.YourCalcControlName
 

Users who are viewing this thread

Back
Top Bottom