• How to stop #error

    Author
    Topic
    #462357

    I have a calculation that takes the sum value from a subform.

    If the subform has no data in it I get #error in the calculation which stuffs up everything else.

    I have tried this

    =nz([sbfQBOrderInfo].[Form]![curBillTot],0)

    but a lack of data due to an empty subform obviously doesn’t return a null

    What should I do for the value to return 0 if the subform is empty?

    Viewing 1 reply thread
    Author
    Replies
    • #1176530

      I have a calculation that takes the sum value from a subform.

      If the subform has no data in it I get #error in the calculation which stuffs up everything else.

      I have tried this

      =nz([sbfQBOrderInfo].[Form]![curBillTot],0)

      but a lack of data due to an empty subform obviously doesn’t return a null

      What should I do for the value to return 0 if the subform is empty?

      Check out this link, especially where it refers to RecordsetClone.RecordCount = 0

      http://bytes.com/topic/access/answers/1938…ubform-mainform

    • #1176548

      Does the sum get calculated in the footer of the subform?

      I just did a test and found that it worked if I put the NZ function in the subform sum.

      =NZ(Sum([Amount]),0)

      • #1176802

        Does the sum get calculated in the footer of the subform?

        I just did a test and found that it worked if I put the NZ function in the subform sum.

        =NZ(Sum([Amount]),0)

        John,
        Long time – hope things are going well.
        I have the same issue but am trying to sum on a form created from a Cross Tab Query. I tried your nz process but did’nt seem to work . Is this because its a cross tab as the source
        Steve (ex Anna Bay)

    Viewing 1 reply thread
    Reply To: How to stop #error

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: