How can i use DCOUNT without getting error when DCOUNT returns null

  • Thread starter Thread starter vasal
  • Start date Start date
V

vasal

Under certain query criteria, a dcount function may return NULL (no records
found).
In that case i get a message saying <Invalid use of null> and the debbuger
gets to the line with the DCOUNT function.

How can i display <0 records found>?
 
Hi Vasal

Use the Nz function to convert the null to zero:
intCount = Nz(DCount(...), 0)
 
Back
Top