Data in Form needs to be transferred to Table

  • Thread starter Thread starter antmorano
  • Start date Start date
A

antmorano

Hello All:

I have a field on my form that caluclates the age of retirees. I need
that age to be placed back into a table called "All Plans." The
reason for this is because I need to run a query that only selects
those retirees that are under 65. If someone knows how I can do this
without having to transfer the data it would be very helpful.
 
Hello All:

I have a field on my form that caluclates the age of retirees. I need
that age to be placed back into a table called "All Plans." The
reason for this is because I need to run a query that only selects
those retirees that are under 65. If someone knows how I can do this
without having to transfer the data it would be very helpful.

The problem with saving the retire's age in a table is that it's
guaranteed to be wrong once per year.

Save the retiree's [date of birth] only.

Then whenever you need the age, calculate it. It's always going to be
accurate.

In a query:
Age: DateDiff("yyyy", [DOB], Date()) - IIF(Format([DOB], "mmdd") >
Format(Date(), "mmdd"), 1, 0)

Directly as the control source of an unbound control:
=DateDiff("yyyy",[DOB],Date())-IIf(Format([DOB],"mmdd")>Format(Date(),
"mmdd"),1,0)
 
Back
Top