Changing chart properties at runtime

  • Thread starter Thread starter Jonathan
  • Start date Start date
J

Jonathan

Hi,
Is there a way to set chart control properties such as Y-axis scale
parameter programmatically?
I want to set this parameters based on values from a table.

This is turning out to be more difficult than I thought it would be. I
tried a number of variations on the theme:


Private Sub Report_Open(Cancel As Integer)
Dim objChart As Object
Set objChart = Me.Graph12
objChart.Object.Axes(2).MaximumScale = Me.Text14
End Sub

No luck so far, just lots of error messages. Any help would be appreciated.


-Jonathan
KingsKnight1 <at> hotmail <dot> com
 
Jon:

The primary problem that you have is that Me.Text14 is unlikely to be
available in the On open event, it hasn't been reached yet in the report so
Access doesn't know what the control (or value) is.

If you want that to work (and your general syntax is fine), then move the
code to the on print event of the section of the report that contains the
graph object and be sure to include the control (it may be invisible) that
contains the value of axis you want; you can test your other code by simply
specifying a hard coded value in the code to start with.
 
Back
Top