Setting the Chart Type from lookup table

alebreuilly

New member
Local time
Today, 21:02
Joined
Jan 18, 2007
Messages
6
Greetings,

I'm currently busy creating a reporting tool In MS Access.

Can anyone tell me how i can set the chart type of a Chart (i.e. xlbarclustered etc) programmatically.

I want the user to select an Chart output from a drop down. Access would then get the record for the selected option and bring back the SQL text for the rowsource and the chart type used to display the data. these settings would then be applied to an existing chart.

My chart options table looks like this..

OptionID -(auto number) e.g. 1
SQL text -(memo) e.g. SELECT ...
ChartType - (text) e.g. xlbarClustered

I can set the rowsource to show the sqltext no problem but i'm having trouble changing the chart type.
any ideas?
 
Here's how I do it using a combo box under a graph object ("gphArrsNoData2"),

The combo box("cboRowSource2") has the chart type (column(7)) and axis minimum and max as columns read from a table, the afterupdate event of the combo box includes this:

With Me

.gphArrsNoData2.Object.Application.Chart.ChartType = CInt(.cboRowSource2.Column(7))
.gphArrsNoData2.Object.Application.Chart.Axes(2).MaximumScale = CLng(.cboRowSource2.Column(9))
.gphArrsNoData2.Object.Application.Chart.Axes(2).MinimumScale = CLng(.cboRowSource2.Column(10))

End With


HTH


Kevin
 

Users who are viewing this thread

Back
Top Bottom