Calculated field

  • Thread starter Thread starter Janet
  • Start date Start date
J

Janet

Is it possible, on a form, to enter values in three fields
in the same record and have the result automatically
entered and saved as the value in a fourth field? I have
had calculated controls on a form before, but this time I
want the value to be automatically saved in a field. If
this can be done, how?
 
-----Original Message-----
Is it possible, on a form, to enter values in three fields
in the same record and have the result automatically
entered and saved as the value in a fourth field? I have
had calculated controls on a form before, but this time I
want the value to be automatically saved in a field. If
this can be done, how?

Janet,

As you're probably aware, this practice is discouraged and
usually unnecessary, since:

- at will you can always display the data in an unbound
control or calculate the value in a query
- there's a chance that changes could be made to the
fields involved in the calculation which would make the
calculated field out-of-date

Assuming you've weighed all this, include the following
code in the AfterUpdate event of each field involved in
the calculation. I've assumed for sake of example that
the calculation is w=x*y*z.

Me!w.Value = Me!x * Me!y * Me!z

HTH
Kevin Sprinkel
Becker & Frondorf
 
Back
Top