Trying to get a 0 value from an empty report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ebasshead
    New Member
    • May 2007
    • 37

    Trying to get a 0 value from an empty report

    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
  • ChipR
    Recognized Expert Top Contributor
    • Jul 2008
    • 1289

    #2
    I remember I got a similar error until I added a "0+" to my expression in a field before.

    Comment

    • ebasshead
      New Member
      • May 2007
      • 37

      #3
      Hi ChipR,

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

      Cheers Ed

      Comment

      • hjozinovic
        New Member
        • Oct 2007
        • 167

        #4
        hi ebasshead,

        You should use Hasdata property for this.
        For a control that sums the expences subreport set a recordsource like this:
        Code:
        =iif(SubReportName.Report.HasData = False ; 0 ; SubReportName.Report.TotalFieldName)

        Comment

        Working...