Basically I am trying to change my pivot chart a bit more dynamically.
I have a sub form with a query recordsource which contains all the fields I would require to create TWO pivot charts.
The sub form opens as pivot chart view and ofcourse is placed as a control on my main form.
I am trying to design my form with some code so that when I click buttons on my main form the data categories on the axis of the pivot chart change to predefined (by the code) data series I have set.
This in my mind seems very simple since it is literally just asking my pivot chart to stop using a category for the Y axis such as [NCCost] to now picking out [NCEventCount] from its record source (query).
I have been looking for ages at code and it seems to always reference excel forums. Anyway.. this is what I have at the moment:
Expand|Select|Wrap|Line Numbers
- Private Sub btnsettocosts_Click()
- Dim objChartSpace As OWC10.ChartSpace
- Dim objPivotChart As OWC10.ChChart
- Dim frmChart As Access.Form
- Set frmChart = Me.Controls("subfrmPivot2").Form
- Set objChartSpace = frmChart.ChartSpace
- Set objPivotChart = objChartSpace.Charts.Item(0)
- End Sub
Thanks for any help,
Chris