How do I add two fields together to make a third in a table?

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

Guest

I am making a database of purchases/sales and I have 1 field for 'price', 1
field for 'postage cost' and 1 field for 'total' (price+postage cost). I have
been entering the information through a form, which calculates the total for
me, but when I went into the table, all the totals are showing as £0.00, even
though this is not the case in the form.
How do I get the 'total' figure calculated on the form to transfer to the
table, the same as all the other data I enter?
 
I am making a database of purchases/sales and I have 1 field for 'price', 1
field for 'postage cost' and 1 field for 'total' (price+postage cost). I have
been entering the information through a form, which calculates the total for
me, but when I went into the table, all the totals are showing as £0.00, even
though this is not the case in the form.
How do I get the 'total' figure calculated on the form to transfer to the
table, the same as all the other data I enter?

You don't!!!
As long as you save the Price and Postage cost data, any time you need
the total cost simply compute it (as you already do in your form) in a
query, or report.
 
I am making a database of purchases/sales and I have 1 field for 'price', 1
field for 'postage cost' and 1 field for 'total' (price+postage cost). I have
been entering the information through a form, which calculates the total for
me, but when I went into the table, all the totals are showing as £0.00, even
though this is not the case in the form.
How do I get the 'total' figure calculated on the form to transfer to the
table, the same as all the other data I enter?

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.

John W. Vinson[MVP]
 
Back
Top