Counting a specific item in a form or report

T

Tim

I would like to be able to count a specific item in a field using a form or
report. For example, I want to count all history under the field class but
not anything else. I tried the count function but unable to get it to count
only a specifc item. I do not know how to write the expression.

This expression does not work but I need something like it.
=count([class]='history"
ts
 
D

Damon Heron

In a textbox's control source, put
=DCount("Class","YourtableName","Class = 'history' ")

if there is a possibility of nulls, then
=nz(DCount("Class","YourtableName","Class = 'history' "),0)

Damon
 
J

Jeff Boyce

Tim

We aren't there. We can't see what you're working on.

"How" depends on "what", and you haven't described your situation.

"count all history under the field class" means something to you, in your
context. If you'll describe that context to us, folks here may be able to
offer more specific assistance.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Top