Storing Subform calculations

  • Thread starter Thread starter BT News
  • Start date Start date
B

BT News

Hi
I have a subform that sums a field and displays it at the bottom of the
subform.
The form that contains the subform has a field that looks up the calculated
field and displys the sum in the form.
I need this calculated value to be able to be saved in a field in the table
that the form is generated from and not just displayed in the form.
Hope that is clear.
Cheers
Ken
 
I need this calculated value to be able to be saved in a field in the table
that the form is generated from and not just displayed in the form.

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.

If you have some *very good* reason to want to store this sum
post back... it's possible, it's just not a good idea.

John W. Vinson[MVP]
 
Back
Top