Group:  Microsoft Access ยป microsoft.public.access.gettingstarted
Thread: saving data from a calculation in the control source

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

saving data from a calculation in the control source
Jeem 19.07.2006 19:16:01
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?
Re: saving data from a calculation in the control source
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> 19.07.2006 19:54:10
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.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Jeem" <Jeem[ at ]discussions.microsoft.com> wrote in message
news:F09EE7C6-2CB4-4D5C-BDE3-730686C7E250[ at ]microsoft.com...
[Quoted Text]
> 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?


RE: saving data from a calculation in the control source
Jeem 20.07.2006 11:27:02
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" wrote:

[Quoted Text]
> 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?
Re: saving data from a calculation in the control source
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> 20.07.2006 18:05:59
Sure. You can use a Select query anywhere you can use a table.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Jeem" <Jeem[ at ]discussions.microsoft.com> wrote in message
news:2897D2D1-D64A-4534-AB93-48A70CC2F75F[ at ]microsoft.com...
[Quoted Text]
> 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" wrote:
>
> > 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?


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net