G
Guest
Hello,
I have a report with a graph which I'm changing its properties dynamically.
I want to change some of the Axes properties.
I tried using the following code: (in the on_Print event of the part in the
report the graph is placed in)
Dim objChart As Graph.Chart
Dim ax As Graph.Axis
If [Forms]![GraphicR]![someValue] = 1 Then
ax = objChart.Axes(xlVertical)
ax.Axistitle.Caption = "something"
End If
But it isn't working. when debuging I can see no value is assigned to ax
after the line:
ax = objChart.Axes(xlVertical)
the debugger writes: a = Nothing
on the other hand, the following code does work:
Dim objChart As Graph.Chart
Dim ax As Graph.Axis
If [Forms]![GraphicR]![someValue] = 1 Then
For Each ax In objChart.Axes
ax.AxisTitle.Caption = "something"
Next
End If
But this code isn't any good for me, since it changes the titles of all the
Axes. Any ideas why the first code isn't working?
thanks,
I have a report with a graph which I'm changing its properties dynamically.
I want to change some of the Axes properties.
I tried using the following code: (in the on_Print event of the part in the
report the graph is placed in)
Dim objChart As Graph.Chart
Dim ax As Graph.Axis
If [Forms]![GraphicR]![someValue] = 1 Then
ax = objChart.Axes(xlVertical)
ax.Axistitle.Caption = "something"
End If
But it isn't working. when debuging I can see no value is assigned to ax
after the line:
ax = objChart.Axes(xlVertical)
the debugger writes: a = Nothing
on the other hand, the following code does work:
Dim objChart As Graph.Chart
Dim ax As Graph.Axis
If [Forms]![GraphicR]![someValue] = 1 Then
For Each ax In objChart.Axes
ax.AxisTitle.Caption = "something"
Next
End If
But this code isn't any good for me, since it changes the titles of all the
Axes. Any ideas why the first code isn't working?
thanks,