General discussion

Locked

Access 2K - Count function

By Adisha ·
Could you please tell me how to count records in a report based on a criteria. I normally set up a text box and type:
=Count([RESULT])
. . .to get the total number of records

I would like something like
= CountIf [RESULT]="Pass"

Many thanks for your helkp in advance

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by techrep In reply to Access 2K - Count functio ...

Use the DCount function to determine the number of records that are in a specified set of records (a domain). For example, you could use the DCount function in a module to return the number of records in an Orders table that correspond to orders placed on a particular date.

Syntax:

DCount(expr, domain[, criteria])

Using your example in a textbox (replace TableName with the appropriate table name):

=Dcount("[RESULT]", "TableName","[RESULT]='Pass'")

Collapse -

by Adisha In reply to

Poster rated this answer.Thank you for your prompt resoponse , but I really need to be able to DCount on groupings.

Collapse -

by Adisha In reply to Access 2K - Count functio ...

This is great! But what if I want to use 'GroupBy' where the report has grouped e.g. [SUBJECT] field according to categories?

something like . . .
=DCount("[RESULT]","tblRESULTS","[RESULT]='Pass'")
. . . Groupby [SUBJECT]

is this possible?

Hope this makes sense . . .

Collapse -

by Adisha In reply to Access 2K - Count functio ...

Point value changed by question poster.

Collapse -

by Adisha In reply to Access 2K - Count functio ...

This question was closed by the author

Back to Software Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums