Show on Report by Age

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

ArneGolf

I meant to say the field names are "Child1Name, Child1Birthday, Child2Name,
Child2Birthday, etc.
 
J

John Spencer

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
 

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