sging1
Sep 6 2005, 03:44 AM
I am putting a report together that simply gives a total of how many records the query generates. The problem is when there are no records I get #Error in the control. Is there a way of getting zero to appear when there aren’t any records to count.
=Count([clientid])
Thanks.
Rammy
Sep 6 2005, 05:50 AM
Try =IIf(IsError(Count([clientid]),0,Count([clientid])
sging1
Sep 6 2005, 05:58 AM
Thanks fr the reply. I'm getting an error with that one something about brackets.
Stephen
Rammy
Sep 6 2005, 06:04 AM
I think it should be this when i've checked it.
=IIf(IsError(Count([clientid])),0,(Count([clientID])))
The brackets always give me trouble.
Hope it works this time!
sging1
Sep 6 2005, 06:07 AM
Thanks it took it this time but it still shows #Error when there are no records. Thanks for the help.
Stephen
Wales
Rammy
Sep 6 2005, 06:33 AM
I think i've hopefully found the answer:
=IIf([clientID] Is Null,0,Count([clientid]))
If not then i've found a way around it which will make your count control's visible property set to No, therefore making it invisible. You will need to put this code in the report's open event.
If DCount("clientid", "YOURTABLENAME") = 0 Then
YOURCOUNTCONTROL.Visible = False
End If
Give it a try and if it still doesn't work let me know.
Edited by: Rammy on Tue Sep 6 7:39:48 EDT 2005.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.