Connecting Tech Pros Worldwide Forums | Help | Site Map

Trying to get a 0 value from an empty report

Newbie
 
Join Date: May 2007
Posts: 27
#1: Dec 1 '08
Hi Everybody,

I've been building a main invoice report which has a seperate itemised and then summed expenses report inserted on the page.

I am then using the summed expenses for a calculation in the main Invoice report.

Everything works fine unless there are no expenses, at which point the expenses report disappears and so does the summed expenses total (which would be 0).

As a result the calculation can't be done on the main Invoice report, and I get an error.

I've tried using an IIF statement with Is Null and 0 and "" in the Sum Expenses textbox, and also in the Itemised Expenses textbox and in the main Invoice report, but no luck.

Can sombody point me in the next direction please.

Thank you in advance

Eddie

Expert
 
Join Date: Jul 2008
Location: Maryland
Posts: 1,175
#2: Dec 1 '08

re: Trying to get a 0 value from an empty report


I remember I got a similar error until I added a "0+" to my expression in a field before.
Newbie
 
Join Date: May 2007
Posts: 27
#3: Dec 1 '08

re: Trying to get a 0 value from an empty report


Hi ChipR,

I tried your suggestion out but so far... no luck

Cheers Ed
Familiar Sight
 
Join Date: Oct 2007
Posts: 154
#4: Dec 2 '08

re: Trying to get a 0 value from an empty report


hi ebasshead,

You should use Hasdata property for this.
For a control that sums the expences subreport set a recordsource like this:
Expand|Select|Wrap|Line Numbers
  1. =iif(SubReportName.Report.HasData = False ; 0 ; SubReportName.Report.TotalFieldName)
Reply


Similar Microsoft Access / VBA bytes