• Access #Error (2000 SR-1)

    • This topic has 3 replies, 3 voices, and was last updated 22 years ago.
    Author
    Topic
    #387022

    I have a couple of sub-reports that occasionally contain no records, so when Access tries to do a calculation in the master report, I get an #Error message. So this may sound like a dumb question, but is there a way to do an if statement where if the calculation results in an #Error, it will replace it with a “”0” (zero). If that can’t be done, how do I get a phantom record to show up in the query, so the report calculations don’t come up as #Error. And no, default values don’t do me any good since there isn’t a record to apply the default values to.

    I

    Viewing 1 reply thread
    Author
    Replies
    • #673840

      In the last couple of weeks Hans came up with a nifty idea to overcome this problem.
      I cannot remember what it was, but it had something to do with the OnNoData event and enabling a making visible a hidden control that had been set to zero.
      If Hans is around I’m sure he will fill you in.

    • #673850

      You can use the HasData property of a (sub)report to test if is is non-empty. See Microsoft Knowledge Base Article 208718 for an example of how to use it.

      In the thread starting at post 248512, Tom Bushaw and I came up with different methods to display something in a report even if there are no data (this is the thread Patt mentioned).

      • #673880

        Thanks very much Hans, I’ll give both solutions a try.

    Viewing 1 reply thread
    Reply To: Access #Error (2000 SR-1)

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

    Your information: