Show on Report by Age

  • Thread starter Thread starter ArneGolf
  • Start date Start date
A

ArneGolf

I am trying to run a report that among other things lists the children names
and ages but only if they are under 23 years old. I am pulling from fields in
a table called "Child1Name", "Child1Birthday", "Child2Name",
"Child2Birthday", etc. Is there an expression or something that I can use to
have it only list the children names only if they are under 23.
 
I meant to say the field names are "Child1Name, Child1Birthday, Child2Name,
Child2Birthday, etc.
 
Given that structure you are going to end up with blanks, but you can use.

IF Child1Birthday < DateAdd("yyyy",-23,Date()) THEN
Me.Child1Name.Visible = False
ELSE
Me.Child1Name.Visible = True
END IF


Or you can return nulls in the underlying query using a calculated field.
Enter this following in an blank field "cell".
Child1: IIF(Child1Birthday < DateAdd("yyyy",-23,Date()),Null,Child1Name)

Repeat for the other pairs of name and birthday and then use the Child1,
Child2, etc in your report.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top