My Assistant
![]() ![]() |
|
|
Sep 6 2005, 03:44 AM
Post
#1
|
|
|
UtterAccess Addict Posts: 148 From: Wales UK |
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. |
|
|
|
Sep 6 2005, 05:50 AM
Post
#2
|
|
|
UtterAccess Member Posts: 49 From: Lancashire, England |
Try =IIf(IsError(Count([clientid]),0,Count([clientid])
|
|
|
|
Sep 6 2005, 05:58 AM
Post
#3
|
|
|
UtterAccess Addict Posts: 148 From: Wales UK |
Thanks fr the reply. I'm getting an error with that one something about brackets.
Stephen |
|
|
|
Sep 6 2005, 06:04 AM
Post
#4
|
|
|
UtterAccess Member Posts: 49 From: Lancashire, England |
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! |
|
|
|
Sep 6 2005, 06:07 AM
Post
#5
|
|
|
UtterAccess Addict Posts: 148 From: Wales UK |
Thanks it took it this time but it still shows #Error when there are no records. Thanks for the help.
Stephen Wales |
|
|
|
Sep 6 2005, 06:33 AM
Post
#6
|
|
|
UtterAccess Member Posts: 49 From: Lancashire, England |
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. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 23rd May 2013 - 07:24 AM |