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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DCount alwaysreturning 1 0
Access MS Access DCount function problem 0
Dcount return incorrect result for filtered record 4
Using dcount... 1
DCount Nulls 4
Dcount in ADP 7
DCount Porblem 4
Dcount help 1

Back
Top