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

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>?
 
G

Graham Mandeno

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

Top