Chart Object in Access 2007

Z

zhuzhuniu

I have simple VBA code to change Y-AXIS scale of the chart in areport and it
worked in Access 2003. But when I run it in access 2007, I keep getting error
Run-time error '2771' The bound or unbound object frame you tried to edit
doesn't contain an OLE object. Below is my code, could anyone help? Many
thanks!

Private Sub Report_Activate()
Dim objChart As Graph.Chart
Dim objAxis As Graph.Axis

Set objChart = Me!Graph0.Object
Set objAxis = objChart.axes(2)

If objAxis.Type = 2 Then
objAxis.maximumscale = 90
objAxis.minimumscale = 60
End If

End Sub
 

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