• Enabling in a report (Access 97 SR2)

    Author
    Topic
    #361882

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #548719

      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.

      • #548725

        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).

        • #548726

          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 smile

          Cheers

          Jayden

    Viewing 0 reply threads
    Reply To: Enabling in a report (Access 97 SR2)

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

    Your information: