view birthdate based on age

  • Thread starter Thread starter BVM
  • Start date Start date
B

BVM

Hi! I have a report set up that prints ID cards for me, but I only need the
birthdate to appear if the person is under 24. Right now I have the birthdate
in a field and I can't figure out which code to use instead. Can someone help
me out with this? Thanks!

BVM
 
Hi! I have a report set up that prints ID cards for me, but I only need the
birthdate to appear if the person is under 24. Right now I have the birthdate
in a field and I can't figure out which code to use instead. Can someone help
me out with this? Thanks!

BVM

Use an unbound control, not the [DOB] control:
=IIf(DateDiff("yyyy",[DOB],Date())<24,[DOB],"")

Make sure the name of this control is not "DOB".
Change DOB to whatever the actual name of the Birthdate field is.
 
It sounds like you are saying that you want to see DOB if age is < 24. That
sounds like something you could do in the query you use to 'feed' your
report...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Thanks so much! I was only able to work on the dbase until today, but it
worked perfectly.

fredg said:
Hi! I have a report set up that prints ID cards for me, but I only need the
birthdate to appear if the person is under 24. Right now I have the birthdate
in a field and I can't figure out which code to use instead. Can someone help
me out with this? Thanks!

BVM

Use an unbound control, not the [DOB] control:
=IIf(DateDiff("yyyy",[DOB],Date())<24,[DOB],"")

Make sure the name of this control is not "DOB".
Change DOB to whatever the actual name of the Birthdate field is.
 

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

Back
Top