Terence-
First you should know that PivotCharts and PivotTables are deprecated in 2013 - not supported anymore.
But having said that, here's some sample code I wrote for a client to manipulate a PivotChart form:
' Point to the chart form
Set frm = Forms!frmGenManYOYPivotChart
' Set the form's caption
frm.Caption = Me.cmbGenNum & " Pivot Chart"
On Error Resume Next
' Delete all captions
For intI = 0 To frm.ChartSpace.Charts(0).SeriesCollection.Count - 1
frm.ChartSpace.Charts(0).SeriesCollection(intI).DataLabelsCollection.Delete 0
Next intI
On Error GoTo PROC_ERR
If Me.cmbTopSeries = 1 Then
' Build a caption
frm.ChartSpace.Charts(0).SeriesCollection(0).DataLabelsCollection.Add
frm.ChartSpace.Charts(0).SeriesCollection(0).DataLabelsCollection(0).Font.Name = "calibri"
frm.ChartSpace.Charts(0).SeriesCollection(0).DataLabelsCollection(0).Font.Size = 12
frm.ChartSpace.Charts(0).SeriesCollection(0).DataLabelsCollection(0).Font.Bold = True
frm.ChartSpace.Charts(0).SeriesCollection(0).DataLabelsCollection(0).NumberFormat = "#,###"
End If
frm.ChartSpace.Charts(0).Axes(1).NumberFormat = "#,###"
Set frm = Forms!frmGenManYOYPivotChart
' Set the form's caption
frm.Caption = Me.cmbGenNum & " Pivot Chart"
On Error Resume Next
' Delete all captions
For intI = 0 To frm.ChartSpace.Charts(0).SeriesCollection.Count - 1
frm.ChartSpace.Charts(0).SeriesCollection(intI).DataLabelsCollection.Delete 0
Next intI
On Error GoTo PROC_ERR
If Me.cmbTopSeries = 1 Then
' Build a caption
frm.ChartSpace.Charts(0).SeriesCollection(0).DataLabelsCollection.Add
frm.ChartSpace.Charts(0).SeriesCollection(0).DataLabelsCollection(0).Font.Name = "calibri"
frm.ChartSpace.Charts(0).SeriesCollection(0).DataLabelsCollection(0).Font.Size = 12
frm.ChartSpace.Charts(0).SeriesCollection(0).DataLabelsCollection(0).Font.Bold = True
frm.ChartSpace.Charts(0).SeriesCollection(0).DataLabelsCollection(0).NumberFormat = "#,###"
End If
frm.ChartSpace.Charts(0).Axes(1).NumberFormat = "#,###"
Hope that points you in the right direction. I don't think PivotCharts have a data table - just the Record Source of the form.
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)
On Mar 5, 2014, at 12:29 PM, <buffalome000@yahoo.com> <buffalome000@yahoo.com> wrote:
I could use some help locating info/documentation on the Pivotchart Object, similar to the MS Graph Object Model reference. At present I have not been able to find a way to toggll (Hide/Show) the data table for the PivotChart. The code beow is what I am using to toggle the dataTable for the Graph object, I am attempting to perfrom the same for the PivotChart via VBA.
With Me![Graph5].Object.Application.chart
.hasdatatable = True
End WithI have attemted to use the Macro recorder in Excel and retro-fit the code to VBA, but I often have difficulties with alterring the code to succesfully work in VBA/MS Access.
Terence
__._,_.___
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (2) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar