• Conditional formatting of a chart in a report (Access2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Conditional formatting of a chart in a report (Access2000)

    Author
    Topic
    #409421

    I have a report with a chart that has one bar. I would like to vary the color based on the value.
    90% to 100% would be green
    75% to 89% would be yellow
    0 to 74 % would be red
    Is there a way to do that in a chart on a report.
    I found some code that I’ve been playing with
    Dim MyChart As Chart
    Set MyChart = Me.chtResolution.Object
    MyChart.SeriesCollection(1).Points(1).Interior.Color = vbRed

    I’m just trying to see if I can change it to red for right now, I can figure for the values later.
    I’ve tried the chart in the header, detail, and footer
    Placed the code in the OnFormat or OnPrint section and can’t get it to work.
    I’m referencing Microsoft Graph 9.0 Object Library.
    this code came from a demo where it worked with a chart embedded in a form.
    I attached the demo.
    I either get a blank chart or this error:
    Run-Time error 1004
    Unable to get the Series Collection property of the Chart class.
    Any ideas would be welcome.
    Scott

    Viewing 1 reply thread
    Author
    Replies
    • #872340

      Forms and reports work very differently. Reports are essentially static, so you have to make any changes *before* you open the report.

    • #872341

      Forms and reports work very differently. Reports are essentially static, so you have to make any changes *before* you open the report.

    Viewing 1 reply thread
    Reply To: Conditional formatting of a chart in a report (Access2000)

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

    Your information: