How to Count Access Records Using Multiple Criteria in a Report
Question details
The user needs to count specific records in a Microsoft Access report based on multiple field criteria, such as filtering by both Contact Type and Contact Method.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Building an Access report to summarize data where totals need to reflect records matching two or more specific conditions.
- Observed behavior
- The user wants to display accurate conditional counts (e.g., Contact Type is 'Testing' and Contact Method is 'Telephone') within a single report footer or grouped section.
Verify that the fields you intend to evaluate (e.g., Contact Type and Contact Method) are included in the underlying record source query of your report.
Use an Aggregate IIf Expression in the Report Footer
Combine the Sum function with an IIf statement to calculate totals for specific conditions directly in your report.
This method allows you to evaluate multiple criteria within a single text box control on your report without altering the underlying query.
Right-click your report in the Access Navigation Pane and select 'Design View'.
Select the 'Text Box' tool from the Controls group on the Report Design Tools ribbon, then click inside the Report Footer or Group Footer to place it.
Select the newly added text box, open the Property Sheet (F4), and click on the 'Data' tab.
In the Control Source property, enter the expression: =Sum(IIf([Contact Type]='Testing' And [Contact Method]='Telephone', 1, 0)).
Switch back to 'Report View' to confirm that the text box accurately counts only the records that match both criteria.
Create a Grouped or Crosstab Query as the Record Source
If you need to display counts for all combinations of Contact Type and Contact Method, generating a Crosstab Query is highly efficient.
Analyze and Count Multi-Criteria Data Easily with WPS Office
While Microsoft Access handles relational databases well, summarizing and counting data with multiple criteria is often much faster using PivotTables in a spreadsheet. WPS Office provides a lightweight, highly compatible, and free alternative to Microsoft Office, making complex data analysis accessible without the need to write SQL or complex expression formulas.

Frequently Asked Questions
Can I use multiple criteria in an Access DCount function?
Yes, you can use the DCount function with a compound criteria string. For example, =DCount("*", "YourTable", "[Contact Type]='Testing' AND [Contact Method]='Telephone'"). This is particularly useful if the fields are not part of the report's main record source.
What is the difference between Sum(IIf()) and Count(IIf()) in Access reports?
The expression =Sum(IIf(condition, 1, 0)) adds up the value '1' every time the condition is true. The expression =Count(IIf(condition, 1, Null)) counts the instances that are not Null. Both achieve the exact same numerical count for your specified criteria.
Why does my text box show '#Error' when calculating the count?
This typically happens if the Name property of your calculation text box is identical to the name of a field in your record source. To fix this, open the Property Sheet, go to the Other tab, and change the Name of the text box to something unique like 'txtTestingTelephoneCount'.




