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.
 
Back
Top