B
Bill-41
I have the following code to create a Pivot table in a subform ..
Dim pTable As PivotTable
Set mainfrm = Forms(Forms("MainForm").Name)
Set subfrm = mainfrm.BillsForm.Form
Set pTable = mainfrm.BillsForm.Form.PivotTable
subfrm.RecordSource = "HumanResourcesData"
Set pFieldSet1 = pTable.ActiveView.FieldSets("Dept")
Set pFieldSet2 = pTable.ActiveView.FieldSets("ParkingLotCode")
Set pFieldSet3 = pTable.ActiveView.FieldSets("EmpId")
pTable.ActiveView.ColumnAxis.InsertFieldSet (pFieldSet1)
pTable.ActiveView.RowAxis.InsertFieldSet (pFieldSet2)
pTable.ActiveView.DataAxis.InsertFieldSet (pFieldSet3)
pTable.ActiveData.HideDetails
Set pField = pTable.ActiveView.FieldSets("EmpId").Fields(0)
Set pTotal = pTable.ActiveView.AddTotal("HeadCount", pField,
plFunctionCount)
pTable.ActiveView.DataAxis.InsertTotal pTotal
I would like to change the Grand Totals column to read just Totals and
change Headcount to just count. I'm having trouble referencing this properly.
Thank you for the help!!!
Dim pTable As PivotTable
Set mainfrm = Forms(Forms("MainForm").Name)
Set subfrm = mainfrm.BillsForm.Form
Set pTable = mainfrm.BillsForm.Form.PivotTable
subfrm.RecordSource = "HumanResourcesData"
Set pFieldSet1 = pTable.ActiveView.FieldSets("Dept")
Set pFieldSet2 = pTable.ActiveView.FieldSets("ParkingLotCode")
Set pFieldSet3 = pTable.ActiveView.FieldSets("EmpId")
pTable.ActiveView.ColumnAxis.InsertFieldSet (pFieldSet1)
pTable.ActiveView.RowAxis.InsertFieldSet (pFieldSet2)
pTable.ActiveView.DataAxis.InsertFieldSet (pFieldSet3)
pTable.ActiveData.HideDetails
Set pField = pTable.ActiveView.FieldSets("EmpId").Fields(0)
Set pTotal = pTable.ActiveView.AddTotal("HeadCount", pField,
plFunctionCount)
pTable.ActiveView.DataAxis.InsertTotal pTotal
I would like to change the Grand Totals column to read just Totals and
change Headcount to just count. I'm having trouble referencing this properly.
Thank you for the help!!!