#Error on Count(*)

G

Guest

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.
 
G

Guest

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
 
G

Guest

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



Michael H said:
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 said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top