Form V Table

  • Thread starter Thread starter Ann
  • Start date Start date
A

Ann

Hi anyone out there who can help me

I have a form created from a course details table which
has the fields:

Course ID
Date
Venue
Trainer (Lookup from Trainer table)
Cost
Number of places

I have a total field in the table and on the form I have a
total field which is cost x number of places - can I get
this total to go back into the table and store there??
The calculation works fine in an unbound control but when
I go back to the table the cost and number of places is
there but not the total??

Thanks in advance.

Ann (Ireland)
 
Well, theoretically, it's a bad idea to store calculated fields in a table. If you really need to store the calculated data into a field, first, you would have to create a field, [Total] in your table first. Then, you will have to trigger the calculations by putting the them in the update events of the operand fields

Hope this helped.
 
when
I go back to the table the cost and number of places is
there but not the total??

It shouldn't be there in the first place!

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