Change chart colors at report run time

G

Guest

How do I get the chart to function on the report? I do not want to use a
subForm on a report, i would much rather have the chart directly on the
report. I also have charts in the Report Heading Section, for use as an
grand overview; and in the Detail Section, for more detailed view.

(I apologize if this is a double post; waited 45 min did not see original)
____________________________________________________

I have been adding charts, Microsoft Graph 2000 Chart, to reports. I saw a
thread that suggested creating chart on a form then cutting and pasting the
chart object on a report. I did that, but I also want to color coordinate the
colors with the data, e.g. Late orders are colored red on a pie chart. So I
typed some code to be executed...

The form uses the code with no problems (KB200527: ACC2000: How to Change
the Colors of a Chart Dynamically)

With grphPieDelStatistics.SeriesCollection(1)
For i = 1 To .Points.Count

If .Points(i).DataLabel.Text Like "Amber*" Then
.Points(i).Interior.ColorIndex = 4
ElseIf .Points(i).DataLabel.Text Like "Red*" Then
.Points(i).Interior.ColorIndex = 41
ElseIf .Points(i).DataLabel.Text Like "Green*" Then
.Points(i).Interior.ColorIndex = 3
ElseIf .Points(i).DataLabel.Text Like "None*" Then
.Points(i).Interior.ColorIndex = 6
End If

Next i
End With

But when the chart is moved to a report, or even created on the report, the
following results: Run-time error '438': Object doesn't support this property
or method. This error occurs here: With
grphPieDelStatistics.SeriesCollection(1) <W.T.F?>

Using the object browser I found that...
on the form:
WithEvents grphPieDelStatistics As ObjectFrame

but on the report:
WithEvents grphPieDelStatistics As _ControlInReportEvents

<Again W.T.F?>

So armed with this new information I searched MSDN, this forum, and Google
for ControlInReportEvents and got NO RESULTS. <And again W.T.F?>

Next step: created an unbound control and using the wizard added a chart.
The same error occured on the report. (did not try use my own data, only
demon (not a typo or abbreviation) data)
____________________________________________________

How do I get the chart to function on the report? I do not want to use a
subForm on a report, i would much rather have the chart directly on the
report. I also have charts in the Report Heading Section, for use as an
grand overview; and in the Detail Section, for more detailed view.
____________________________________________________

My software:

Win XP, Office XP, but Access 2000

References:
Microsoft Graph 10.0 Object Library
Microsoft Scripting runtime
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.1 Library
OLE Automation
Microsoft Access 9.0 Object Library
Visual Basic For Applications

(Thanks to John Nurick and Joe Fallon with my schema.ini problem, fixed, but
then the way data exported has changed... lets take all the data from the
originating tables, export them to one CSV with a tag indicating in what
table the record originated, then import into one access table, then use
create and delete queries to move the data into respective tables.... all
while keeping cucceny data as text and accounting for only 2 date types, one
of which is mislabled in the user interface, and keeping spaces in field
names.... ...so then i asked: Why can't we use note cards and a card
catalogue?)
 
G

Guest

Sooo... maybe I should move the code to Detail.OnFormat before I post next
time.... That was my problem and now it is solved. yea.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top