Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Gillingham, Kent, England
    Posts
    511
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Enabling in a report (Access 97 SR2)

    I have a report that has a pie chart in the details section, so that the chart is displayed for each detail. However, i'd like the chart to not be displayed when there is no data or the data is incorrect i.e. totals up to over 100%.
    Can anyone tell me where i'd put the syntax for this. It doesn't matter if the charts visible property is set to false or the chart is somehow set not run at all for that record - either way i'd like it not to appear. Is there a way to do this, and if there is, will it do it for each record or is it only possible to set the properties the once. Any help would be er... helpful. Thanks very much in advance.

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Enabling in a report (Access 97 SR2)

    Probably the simplest way would be to set the Visible property to False when there is no data. You would need to open a recordset similar to that being used to generate the chart in order to see if there was any data, it totaled correctly, etc. If you are printing each chart on a separate page then it is pretty easy to kick off the code as a part of the Format Page event. Otherwise dealing with multiple records on one page could be real tricky - you are likely to always have it off or always have it on. Give it a try and see what happens.
    Wendell

  3. #3
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Wellington, New Zealand
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Enabling in a report (Access 97 SR2)

    If you do have multiple records on a page, instead of using the On Format event of the page, use the On Format event of the Detail section (right click the detail bar in design view of the report, select properties, click the event tab and you should see the On Format event).

  4. #4
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Wellington, New Zealand
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Enabling in a report (Access 97 SR2)

    Hi

    I've attached a zip file, with two databases (identible, except that one is a access97 version).

    The contain a mock up of how I would go about this:

    There are two report, one which shows 'correct' results for all graphs. Another which shows results from a table where the results are over 100% for one day, so the graph is not shown.

    Personally, I would concentrate on the reason why your graphs are not adding up to 100% - this may be an indication that there are queries that are not correct or dodgey data somewhere.

    Hope these files illustrate it better <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Cheers

    Jayden
    Attached Files Attached Files

Posting Permissions

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