Counting in Reports

  • Thread starter Thread starter CRBI
  • Start date Start date
C

CRBI

I have reports I have to run whether there is any data or not. If there is
none, I have to show that. When I use the Count(*) function it gives me an
error if there is no data, but I need it to display zero in numberical form
(0). Any suggestions on how I might accomplish this?

Thanks for any help.
 
I have reports I have to run whether there is any data or not. If there is
none, I have to show that. When I use the Count(*) function it gives me an
error if there is no data, but I need it to display zero in numberical form
(0). Any suggestions on how I might accomplish this?

Thanks for any help.

Use the report's OnNoData event. That's what it's for.

You wish to show 0 where?
My suggestion is to simply add a label to the report:
"No data for this report." (or "0")
Make it not visible.

Code the OnNoData event:

Me.LabelName.Visible = True

Or ... You might also wish to hide all of the other controls on the
report when you display this label so it just shows the one "0".

Dim c as control
For each c in Me.controls
c.visible = Not c.visible
Next
 
Back
Top