calculated field problem

  • Thread starter Thread starter Richard Farrell
  • Start date Start date
R

Richard Farrell

I have a table dates weights and a form dates and weights.
To calculate a value such as. Total cost. I go to the
properties box and in the control source of the form and I
type. =[cost per ton] * [weight] this correctly calculates
and posts the number in the total cost text box.
However because these calculations occured in the form
when you go back to the table dates & weights the total
cost column is empty. I was trying to create some reports
from my table data and it is incomplete. how can I get the
form data (calculations that are performed in the form) to
post in the table.

Thank You
Richard Farrell
 
While it is possible, it is not considered proper practice to store values
that can be easily calculated. Instead, just do the same thing in the report
that you are in the form, calculate the answer in a textbox.

Usually, you would store calculated data if it was needed for historical
purposes and the basis on which the calculation would be made may change.
However, even that can sometimes be worked around by creating a table to
hold the calculation criteria and the date it went into effect.
 
You would have to write an update query to do that but i
see problems since you(i assume) only have one item at a
time in your form. It might be best for your report to
write a query to select the data you want then in the
header of a query column enter this:
Total Cost:[cost per ton]*[wieght]
this will calculate for all items. then use the query as a
record source for your report.
Since you want to populate your table with total costs, i
would use the above to write an update query to populate
your table then i would draw the table data into the form
instead of having the form calculate it.
 
Back
Top