conditional statements

K

Karen

I have a report that is generated from a parameter query and I would like to
include a conditional statement in that report where the result is dependent
on age (at the time the record was made) and gender.
If age is <16 years then there are 9 different statements depending on
various age ranges. None of these are dependent on gender.
If age is >17 years AND female there is 1 statement
If age is >17 <65 AND male there is 1 statement
If age is >66 AND male there is 1 statement

Any suggestions as to how to achieve this would be much appreciated.
Karen
 
K

Klatuu

Select Case [age]
Case < 16
Select Case [age]
Case age range 1
Case age range 2
....
Case age range 9
End Select
Case > 17
If [gender] = "f" Then
'Do the female thing
Else
If [age] < 65 Then
'Do the male thing
End If
End If
Case > 66
If [gender] = "male" Then
'Do the Old Guy thing
End If
Case Else
'The person is 16, 17, 64, or 65
'Your rules don't include them
End Select
 

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