Count function on a check box

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

Guest

On a report I want to count the number of times a check box is checked at
each change in the group? This a y/n checkbox in the table.

I know I can use the format property but cannot get the code quite right.

=count([cbFieldName]=true)

I am using Access 97

Thanks!

Marianne
 
Marianne said:
On a report I want to count the number of times a check box is checked at
each change in the group? This a y/n checkbox in the table.

I know I can use the format property but cannot get the code quite right.

=count([cbFieldName]=true)

I am using Access 97


The control source expression could be any of:
=Count(IIf(tablefield, 1, Null))
or
=Sum(IIf(tablefield, 1, 0))
or
=Abs(Sum(tablefield))

Note that tablefield must be a field in the report's record
source table/query, not a control on the report.
 
Back
Top