Hi,
Your data does not sound to be normalized, but lucky you, you MAY be able to
use a crosstab, directly, to reach the result you seek:
TRANSFORM Nz(COUNT(*), 0)
SELECT "total"
FROM myTable, PossibleChoices
WHERE d IN(f1, f2, f3, f4, f5)
GROUP BY "total"
PIVOT d
There are 2 tables, the original table, with fields( id, f1, f2, f3, f4,
f5) -- yours go up to 25, change the IN() clause appropriately
and table PossibleChoices, one field, d, with as many record as there is
possible choice (ie, if there is 100 possible choices, that makes 100
records).
The query returns the number of occurrences of each choice, "by id"... and
unless a choice is NEVER used, the choice will appear under a field with its
"name". In:
Query61
Expr1002 1 2 3 4 5 6 7 9
total 3 2 1 1 2 1 2 2
you can observe that choice "8" is missing, because no initial record ever
speaks of it, in my data.
I also ASSUMED there is not duplicated selected choices, per original
record. If there are, the choice is counted once only.
Table32
ID f1 f2 f3 f4 f5
1 1 2 4 9 9
here, 9 is mentioned twice, but will be counted only once.
For more than that, you SHOULD go to a normalized table design.
Hoping it may help,
Vanderghast, Access MVP