View Full Version : Counting in a Report


biker
07-06-2005, 06:21 AM
Hello,

I'm new here and not an Access expert by any means. Using A2003 and have a problem in a report. I have a form with a column of 3 combo boxes B1, B2, B3 with the same dropdown list in each. Beside these are related combo boxes named Approved1 Approved2 Approved3 with the options Yes and No.

I have a count field as follows which works fine. This counts the number of times Attendance occurs in any of the 3 combo boxes.

=Count((IIf([B1]="Attendance",0) & (IIf([B2]="Attendance",0) & (IIf([B3]="Attendance",0)))))

However, the next step for my report is the following count - apologies for clumsy way of describing it :( I've tried writing the code but just can't get it to work, any help much appreciated. Basically I want to count the number of occurances of Attendance where the associated Approved combo box = yes.

something like ...

=Count((IIf([B1]="Attendance",0) & (IIf([B2]="Attendance",0) & (IIf([B3]="Attendance",0))))) where Approved1 or Approved2 or Approved3 =Yes.

In other words, I want to count the occurences in the 3 rows /2 columns of combo boxes where in the first column Attendance has been selected and where in the same row Yes is selected in the Approved combo box column.

I hope that explains it well enough. Happy to provide more info if necessary and appreciate any help.

Cheers
biker