Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Mar 2002
    Location
    Chicago, Illinois, USA
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access #Error (2000 SR-1)

    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

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Access #Error (2000 SR-1)

    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.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access #Error (2000 SR-1)

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

    In the thread starting at <post#=248512>post 248512</post#>, 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).

  4. #4
    Star Lounger
    Join Date
    Mar 2002
    Location
    Chicago, Illinois, USA
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access #Error (2000 SR-1)

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •