How to make a form field bound to a table equal a calculated fie

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need some help. I am trying to store a tax value derived from a calculated
field on the same form. How can this be achived?


Thanks
 
First the preaching, then the answer.
One of the basic rules of database design is never store calculated values
in a table. It wastes space and they can become incorrect for various
reasons. The better approach is to write a function that performs the
calculation and call that function from whereever you need to see the result
of the calculation. Using this single function means the calculation will
always be consistent and should business rules require a change in the
calculation, you will have only one place to have to change and test it.

Now the answer (should you choose to ignore sound and reasonable database
rules)

Bind the control where the calculation is displayed to the field in your
form's recordset where you want to store it. It is perfectly okay to perform
calculations to a bound field. Whatever value is in the control when the
record is updated will be stored in the field.
 
Back
Top