Report Graph Object Error Message

Report Graph Object Error Message

Post by AaronWestc » Sun, 01 Jul 2007 00:23:33


I hope someone can help.

I am trying to use VBA to set the colors for the slices in a pie chart. My
problem is with accessing the object itself.

I am using the following code in a command button on a seperate form (Form1):

Dim myChart As Graph.Chart
Set myChart = Reports!Report2.Graph0.Object.Application.Chart

myChart.HasTitle = True
myChart.ChartTitle = "Aaron"

I am getting the error on click "Invalid Outside Procedure" and the problem
seems to be the Set statement. Any ideas what I am doing wrong?

Thanks,

Aaron

--
Message posted via AccessMonster.com
http://www.yqcomputer.com/
 
 
 

Report Graph Object Error Message

Post by JHB » Sun, 01 Jul 2007 05:00:28

Hello.
You are missing the Caption.
So it must be
myChart.ChartTitle.Caption = "Aaron"

Regards
Jn

"AaronWestcott via AccessMonster.com" <u30340@uwe> skrev i en meddelelse

My
(Form1):
problem