What is the limit for nesting IIF functions?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table with a number of 'true/false' fields.
It's a list of members of a high school class and there is a 'true/false'
field for clubs etc. that each graduate may have been in.

I am attempting to generate a report that will list all the 'True' fields
and the only way I know of is through the use of nested IIF functions that
will print the (for example) club name if the associated field is 'true'
indicating that they were in that club.

Is there a better way to do this? If not, I imagine there is a limit to the
number of levels that can be nested in an IIF function but I couldn't find it
referenced in the help section.

Thanks in advance for any help.

-Ralph Page
 
I think your issue is use multiple true/false fields. Participation in clubs
and other activities should be recorded in a separate table where one
student participating in a single activity creates a single record. This
makes querying very easy. If correcting your structure isn't possible, you
could normalize your table with a union query:
SELECT StudentID, "Chess" as Activity
FROM tblStudents
WHERE [Chess] = True
UNION ALL

SELECT StudentID, "Naked Volleyball"
FROM tblStudents
WHERE [NakedVolleyball] = True
UNION ALL
SELECT StudentID, "Soccer"
FROM tblStudents
WHERE [Soccer] = True
UNION ALL
etc.

You can then create a query based ont he Activity field.
 
Duane, thanks for the suggestions, I am very new to Access. I'll either
modify the database or try the union querry. Sadly, since this was a class of
'31, Naked Volleyball was not on the activity list.

-Ralph
 
Back
Top