Running Calculations in fields on a form

  • Thread starter Thread starter rglasunow
  • Start date Start date
R

rglasunow

I am trying to run a few calculations on a form of mine and save the
information into a table. All the fields on my form are saving into
the correct locations in my table. Now I need to run calculations
between some of the fields and it is not working. I've used the
expression builder and it will not work. I would like to mulitply 3
fields on my form and divide it by 17. Then just have that information
populate a particular field. Is this possible to do? I've tried
looking through my access bible and I'm at a loss.
Thank you!
 
You need to have code on the AfterUpdate Event of your three text boxes, with the AfterUpdate place the follow text and replace txtBoxN with your textbox names

txtBox4 = (txtBox1 * txtBox2 * txtBox3) / 17

ciao
KM

----- rglasunow wrote: -----


I am trying to run a few calculations on a form of mine and save the
information into a table. All the fields on my form are saving into
the correct locations in my table. Now I need to run calculations
between some of the fields and it is not working. I've used the
expression builder and it will not work. I would like to mulitply 3
fields on my form and divide it by 17. Then just have that information
populate a particular field. Is this possible to do? I've tried
looking through my access bible and I'm at a loss.
Thank you!
 
I am trying to run a few calculations on a form of mine and save the
information into a table.

Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just redo the calculation whenever you need it, either as a
calculated field in a Query or just as you're now doing it -
in the control source of a Form or a Report textbox.
 
Back
Top