result of forms to field in table

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

Guest

I have a form with the following:

Certification Date is [CERTDATE]
Expiration Date is [ED1}

When CERTDATE is entered in the form then ED1 shows the the result of
=DateAdd("m",36,[CERTDATE]-1). What I would like is the result showing in
the form to placed in the ED1 field in the table, so when I do queries based
on the table, Ed1 info would be there. Anyone help?
 
That is duplicate information and not recommended in good database design.

When you need to see that number in a query, simply insert your formula.

You do not store every possible result of a calculation in your database.
Where would it end?


In a new column of a query, simply put the following when you ened it:

ED1=DateAdd("m",36,[CERTDATE]-1)
 
I have a form with the following:

Certification Date is [CERTDATE]
Expiration Date is [ED1}

When CERTDATE is entered in the form then ED1 shows the the result of
=DateAdd("m",36,[CERTDATE]-1). What I would like is the result showing in
the form to placed in the ED1 field in the table, so when I do queries based
on the table, Ed1 info would be there. Anyone help?

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.

Simply put the DateAdd function in a vacant Field cell in any query
that needs it. You can use it for sorting, searching, whatever you
need.

John W. Vinson[MVP]
 
Back
Top