Help

  • Thread starter Thread starter md
  • Start date Start date
M

md

How do I do this? I have two parts on my data base. One
includes birthdate and the other current age. In the
section that has current age, I would like to have a
formula that would take the current year minus the
birthdate and automatically input the information.

Can someone help me? Do I need a visual basic formula?
Is it something that can be done easily?

I do not know any VB and I am terrible at programming so
the help has to be a step by step process.

Thanks.
 
How do I do this? I have two parts on my data base. One
includes birthdate and the other current age. In the
section that has current age, I would like to have a
formula that would take the current year minus the
birthdate and automatically input the information.

Can someone help me? Do I need a visual basic formula?
Is it something that can be done easily?

I do not know any VB and I am terrible at programming so
the help has to be a step by step process.

Thanks.

Well... the age should NOT exist *in any table*, period. I don't know
what you mean by "parts on my data base" in this context, but the Age
should be calculated as needed, and *not* stored anywhere.

You can type the following expression in a vacant Field cell in a
query based on the table containing the birthdate:

Age: DateDiff("yyyy", [birthdate], Date()) - IIF(Format([birthdate],
"mmdd") > Format(Date()), "mmdd"), 1, 0)

Or, if you just want to display the age on a Form or Report, put

=DateDiff("yyyy", [birthdate], Date()) - IIF(Format([birthdate],
"mmdd") > Format(Date()), "mmdd"), 1, 0)

in the Control Source property of a textbox on that form/report.
 
Back
Top