2003 sum in report footer and no data problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JeffP

    2003 sum in report footer and no data problem

    Have a textbox in a report footer that sums data using Sum. That text box
    value is used in a few calculations in the footer.

    Trouble is, if the report has no data then the box simply shows #error and
    all following calculations fail. Nz doesn't work.

    In this case it is still valid for the report to show calculated values in
    the footer even though the report actually contains no data. Values used
    come from other places than the report data.

    Is there anyway to get that text box with the Sum statement to show 0 rather
    than #error?

    Jeff


  • Roger

    #2
    Re: 2003 sum in report footer and no data problem

    On Apr 23, 12:03 am, "JeffP" <no-re...@asken.com .auwrote:
    Have a textbox in a report footer that sums data using Sum. That text box
    value is used in a few calculations in the footer.
    >
    Trouble is, if the report has no data then the box simply shows #error and
    all following calculations fail. Nz doesn't work.
    >
    In this case it is still valid for the report to show calculated values in
    the footer even though the report actually contains no data. Values used
    come from other places than the report data.
    >
    Is there anyway to get that text box with the Sum statement to show 0 rather
    than #error?
    >
    Jeff
    the form has an 'hasData' event
    create a hidden text box in your footer
    and add this to the event
    txtNoData = 1
    txtSum.visible = false ' hides #error

    and use txtNoData in your calculations
    iif(txtNoData,0 ,txtSum) + ......

    Comment

    Working...