A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#Error on Count(*)



 
 
Thread Tools Display Modes
  #1  
Old May 17th, 2006, 08:15 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default #Error on Count(*)

Report contains field where the control source is =Count(*). When there are
no records, #Error is returned. Is there a way to have "no records found"
appear instead of this "#error"? Thx.
  #2  
Old May 17th, 2006, 09:01 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default #Error on Count(*)

Hi.

There may be a better way, but here's how I got this to work:

Add a new TextBox with the Control Source set to =Count(*). Name it
"txtCount2" (or similar), and make it invisible. Now change the Control
Source of your original TextBox to:
=IIf(IsError([txtCount2]),"",Count(*))

-Michael



"christyh" wrote:

Report contains field where the control source is =Count(*). When there are
no records, #Error is returned. Is there a way to have "no records found"
appear instead of this "#error"? Thx.

  #3  
Old May 17th, 2006, 09:05 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default #Error on Count(*)

Thank you for your input. I also found that this seems to work:
=IIf([HasData],Count([FIELDName]),"No records found")



"Michael H" wrote:

Hi.

There may be a better way, but here's how I got this to work:

Add a new TextBox with the Control Source set to =Count(*). Name it
"txtCount2" (or similar), and make it invisible. Now change the Control
Source of your original TextBox to:
=IIf(IsError([txtCount2]),"",Count(*))

-Michael



"christyh" wrote:

Report contains field where the control source is =Count(*). When there are
no records, #Error is returned. Is there a way to have "no records found"
appear instead of this "#error"? Thx.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
type conversion erron in update querry Leonard Hart Running & Setting Up Queries 1 June 3rd, 2004 01:11 AM


All times are GMT +1. The time now is 09:16 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.