saving data from a calculation in the control source

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?
 
D

Douglas J. Steele

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.
 
G

Guest

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?
 
D

Douglas J. Steele

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?
 

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

Top