Data in Form needs to be transferred to Table

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

fredg

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)
 

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