Forms, add 2 fields and updating to data base results

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

Guest

I have a amount due field in which I Subtract money received from total. Math
is find, however I will not update the data base for that field. I need this
information on other querys, and reports. How do you force the field to
update?
 
If you can calculate the value for your form, then you can use exactly the
same calculation in any query or report. No need to store it in the table.
 
I have a amount due field in which I Subtract money received from total. Math
is find, however I will not update the data base for that field. I need this
information on other querys, and reports. How do you force the field to
update?

Generally, you don't.

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]
 
Its for a voluntary Fire Company with 58 members in it, would not use up much
space. Like to have it that any officer can pull Dues information, but not
be able to adjust amounts on Finicial officer.
 
Its for a voluntary Fire Company with 58 members in it, would not use up much
space. Like to have it that any officer can pull Dues information, but not
be able to adjust amounts on Finicial officer.

The space is only a minor part of the problem.

Suppose you had a sum of 44 records that came to $1382.45.

You realize that one of those 44 records was entered incorrectly; it was
entered as $1000 and it should have been $100.

You fix that record.

The sum of the 44 records is now $482.45. Your *STORED* total field is
$1382.45; fixing the error won't change that stored value.

You're saying that this is a satisfactory outcome...!?

If you want the totals to not be adjustable, then you WANT to calculate them
on demand, and *not* store them. A stored value can be adjusted; a calculated
total cannot, because it's calculated directly from the source data.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top