age calculator to display months as well as years

K

Karen

I want Access (97) to calculate somebody's age. I know you
can do that by setting the Control Source property of a
textbox to

=DateDiff("yyyy",[Date],Date())+(Format([Date],"mmdd")
Format(Date(),"mmdd"))

but that will "just" display the person's age in years
whereas I'm looking for months as well.

Anybody has an idea how to do this without including a
macro?

Karen
 
R

Rick B

Do a search. This was answered within the last three weeks or so. I
remember seeing it posted.

Rick B


I want Access (97) to calculate somebody's age. I know you
can do that by setting the Control Source property of a
textbox to

=DateDiff("yyyy",[Date],Date())+(Format([Date],"mmdd")
Format(Date(),"mmdd"))

but that will "just" display the person's age in years
whereas I'm looking for months as well.

Anybody has an idea how to do this without including a
macro?

Karen
 
F

fredg

I want Access (97) to calculate somebody's age. I know you
can do that by setting the Control Source property of a
textbox to

=DateDiff("yyyy",[Date],Date())+(Format([Date],"mmdd")
Format(Date(),"mmdd"))

but that will "just" display the person's age in years
whereas I'm looking for months as well.

Anybody has an idea how to do this without including a
macro?

Karen

You'll need code!

See Doug Steele's code at:
http://members.rogers.com/douglas.j.steele/Diff2Dates.html
 
G

Graham R Seach

In addition to the fine code on Doug's site, there's also this:
http://www.pacificdb.com.au/MVP/Code/Age2.htm

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html


fredg said:
I want Access (97) to calculate somebody's age. I know you
can do that by setting the Control Source property of a
textbox to

=DateDiff("yyyy",[Date],Date())+(Format([Date],"mmdd")
Format(Date(),"mmdd"))

but that will "just" display the person's age in years
whereas I'm looking for months as well.

Anybody has an idea how to do this without including a
macro?

Karen

You'll need code!

See Doug Steele's code at:
http://members.rogers.com/douglas.j.steele/Diff2Dates.html
 

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