saving data from a calculation in the control source

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

Guest

I have set up a field to calculate the "calibration due date" with the
=DateSerial(Year([LastCal]),Month([LastCal])+[CalFreq],Day([LastCal])) in the
control source field of CalDue. The due date calculates but the problem is
that it does not save in the table. How can I get the data to save in the
CalDue field of the table?
 
You shouldn't store it.

As fellow Access MVP John Vinson likes to say "Storing calculated data
generally accomplishes only three things: it wastes disk space, it wastes
time (a disk fetch is much slower than almost any reasonable calculation),
and it risks data validity, since once it's stored in a table either the
Total or one of the fields that goes into the total may be changed, making
the value WRONG."

Instead, you should create a query that contains the necessary information
from the table, as well as calculates the totals by joining to the
appropriate tables and counting the entries. Use the query wherever you
would otherwise have used the table.
 
Thanks Doug, that helps but..... I need to generate a query from the results
of the query set up to calculate the cal due date. I need to generate a
report that identifies all equipment that requires calibration in any given
month. Can I do this?
 
Sure. You can use a Select query anywhere you can use a table.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Jeem said:
Thanks Doug, that helps but..... I need to generate a query from the results
of the query set up to calculate the cal due date. I need to generate a
report that identifies all equipment that requires calibration in any given
month. Can I do this?

Jeem said:
I have set up a field to calculate the "calibration due date" with the
=DateSerial(Year([LastCal]),Month([LastCal])+[CalFreq],Day([LastCal])) in the
control source field of CalDue. The due date calculates but the problem is
that it does not save in the table. How can I get the data to save in the
CalDue field of the table?
 
Back
Top