Report Footer Count

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to count the total records in a report footer using the following
function:
=Count([MK DB Name])

When there are records it seems to work fine. However, when there are no
records I want it to print "0". I tried an IIF statement using a nested
ISERROR but I got the same results. Any ideas how to craft the statement so
I can get rid of #error that is displayed?

Thanks
 
I am trying to count the total records in a report footer using the following
function:
=Count([MK DB Name])

When there are records it seems to work fine. However, when there are no
records I want it to print "0". I tried an IIF statement using a nested
ISERROR but I got the same results. Any ideas how to craft the statement so
I can get rid of #error that is displayed?

Thanks

Use the Report's OnNoData event.

Place a label over the control used to show the count.
Set the caption to 0
Make it Not Visible
Name it lblShowZero

Code the Report's OnNoData event:
[lblShowZero].Visible = True
[ControlUsedToShowCount].Visible = False

Why not just cancel the report if there are no records?
In the OnNoData Event:
MsgBox "There are no records to report on"
Cancel = True
 

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

Back
Top