view birthdate based on age

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
 
F

fredg

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

Jeff Boyce

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
 
B

BVM

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