Count the number of records in a table/query.
Syntax DCount ( expression, domain, [criteria] ) =DCount("[Field]", "Table", "[Field] = 'MyValue'") Key expression The field to count. domain The set of records, a table or a query name. criteria Equivalent to an (optional) WHERE clause. Any field that is included in criteria must also be a field in domain.
The DCount() function can be used in VBA or in an SQL query.
DCount("OrderID", "T_Orders", "SupplierID = 64 ")
This is equivalent to:
“If you are planning for a year, sow rice; if you are planning for a decade, plant trees; if you are planning for a lifetime, educate people” ~ Chinese Proverb
Count (SQL) - Count records
Nz - Detect a NULL value.