View Full Version : Query with no results (Zero Count)


gold007eye
06-26-2006, 08:07 AM
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 (http://listenloudly.com/AccessDB/samples.htm) of both scenerios:

neileg
06-27-2006, 01:34 AM
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.

gold007eye
06-27-2006, 05:38 AM
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.