Query with no results (Zero Count)

gold007eye

Registered User.
Local time
Today, 14:37
Joined
May 11, 2005
Messages
260
I have created a query to count the number of records that are "Pending" over 3 days and I am putting the results total on a form. This is working fine when there are >0 records found, but my problem I can't seem to figure out is how to get the form to display "0" in "Text5" when NO results were found in the query.

I have tried everything, but all I get is a blank form when NO results were found. I have attached the database so you can see the sample of what I am talking about. Just run the 2 forms to see the difference.

Please let me know what I am doing wrong or how I can get a Zero Count query to show up as 0 in the text field on the form.

Also there are screenprints here of both scenerios:
 

Attachments

I can't open your file since I only have Access 2000. However, I suspect that instead of a query, you may get what you want using DCount() which will return a zero if there are no records.
 
Could you possibly give me the Dcount code I should be using and where I should place it? I was using the Dcount function, but if the query had no results it wasn't showing 0 on the form it just showed a blank form. I am stumped on this one. I am also attaching a 2000 version of the database so you will be able to open it.
 

Attachments

Users who are viewing this thread

Back
Top Bottom