Changing chart properties at runtime

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
 
S

SA

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.
 

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