PivotTable programming
I have created a simple pivot table with a Date field as a column.
In the following code segment shown below, the lines:-
Set fset1 = .FieldSets("LabReceivedDate By Mon")
.ColumnAxis.InsertFieldSet fset1
work, but they insert all the child date fields Years, Quarters, Months etc.
I only want to insert and display the Years and Months. -
Can any one help with the syntax?
Code segment start:
DoCmd.OpenForm strFormName, acFormPivotTable
Set frm1 = Forms(strFormName)
With frm1.PivotTable.ActiveView
'Assign fieldset members to the column, row, and detail sections of
'the PivotTable
Set fset1 = .FieldSets("ClientCode")
.FilterAxis.InsertFieldSet fset1
Set fset1 = .FieldSets("LabReceivedDate By Mon")
.ColumnAxis.InsertFieldSet fset1
Set fset1 = .FieldSets("Vessel")
.RowAxis.InsertFieldSet fset1
Set fset1 = .FieldSets("LabRef")
.DataAxis.InsertFieldSet fset1
End With
'Close form with its PivotTable view
DoCmd.Close acForm, strFormName, acSaveYes
Code segment end:
Cheers Ray
__________________
Cheers Ray
|