#Error is diplayed instead of zero (0) on report from subreport.

L

Lu

When a sub report count value is zero (0), it displays '#Error' on main /
parent Report instead of 0, Else if value is 1 and above the #error is not
displayed and values 1,2,3,4... show correctly.

I tried the following so far
1: =Sum(Reports!estabnow!estabsub.Report!subnow) - on main report
2:=Reports!estabnow!estabsub.Report!subnow - on main report
3:=NZ(Count([EMpcode])) - on sub report
4:=Count([emprank]) & IIf(Count([empcode])=0,0) - on sub report

Am dying for urgent help from any one please.
 
J

John Spencer MVP

You need to have a control on the sub-report that gets the value you want to
use on the main report. So Option 3 is probably what you need.

On the main report, you need to test the HasData property of the sub-report
control and return zero if it is false and refer to the control on the
sub-report if it is true.

So, your expression should be something like:

=IIF(Reports!estabnow!estabsub.HasData,Reports!estabnow!estabsub.Report!subnow,0)

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

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