How to print zero instead of nothing if no data on subreport

G

Guest

I have a main report grouped by Department Manager. I have two subreports
under each manager that: 1. counts the new ideas submitted and 2. counts the
number of ideas implemented. If no ideas were either submitted or
implemented in a quarter, that managers section is blank. I would like for
it to put "0" instead. How would I do that? subreports are based on two
different queries with date parameters for criteria.
 
D

Duane Hookom

You can use a text box with a control source like:
=IIf(srprtIdeas.Report.HasData,srptIdeas.Report.txtTotal, 0)
 
A

Allen Browne

Simplest way to get a zero on the report if there are no records in the
subreport would be to put a text box on the main report, and set its
ControlSource to something like this:
=IIf([Sub1].[Report].[HasData], Null, 0)
where "Sub1" is the name of your subreport control.
 
J

Jim/Chris

A vey simple way to display zero for a Null field is to use
a custom format. Set the text box's Format property to
something like:

#,##0;-#,##0;0;0

Jim
 
D

Duane Hookom

This works but not for the OP (original post) since the question referred to
a subreport value.
 
G

Guest

Thanks so much. Worked perfectly. I messed around with a text box and IIF
statement, but couldnt get it to work right. This helped tremendously.
 

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

Top