ivanchain


Re: Visual Basic General OWC: HOW TO hide the PivotTable's field dropzone?

Bruno Yu - MSFT

ivanchain,

According to your demand on hiding the drop zone of PivotTable's field, I would like to recommend you to read the following article that can help you with the problem:

Programming PivotTable Reports in Microsoft Access 2002

http://msdn2.microsoft.com/en-us/library/aa139960(office.10).aspx

Code Snippet

Sub AddTotalsToPivotTable()

'Requires reference to OWC10.dll

Dim pTable As OWC10.PivotTable

Dim pTableView As OWC10.PivotView

Dim pDataAxis As OWC10.PivotDataAxis

DoCmd.OpenForm("Invoices", acFormPivotTable)

pTable = Forms("Invoices").PivotTable

pTableView = pTable.ActiveView

'Refer to DataAxis property

pDataAxis = pTableView.DataAxis

On Error GoTo AddTotalsToPivotTable_Err

'Use InsertTotal method to add each Total

pDataAxis.InsertTotal(pTableView.Totals("PriceTotal"))

pDataAxis.InsertTotal(pTableView.Totals("OrderCount"))

pDataAxis.InsertTotal(pTableView.Totals("PriceAverage"))

'Format the appropriate totals as Currency

pDataAxis.Totals("PriceTotal").NumberFormat = _

"Currency"

pDataAxis.Totals("PriceAverage").NumberFormat = _

"Currency"

'Hide detail data or otherwise the user will see a

'"No Details" message in the PivotTable

pTable.ActiveData.HideDetails()

Exit Sub

AddTotalsToPivotTable_Err:

If Err.Number = 9 Then

AddCalculatedPivotTotal()

Resume

End If

End Sub

Please change the OWC 10.0 to 11.0 according to your application. I hope that can help you.






Re: Visual Basic General OWC: HOW TO hide the PivotTable's field dropzone?

ivanchain

Thanks!

But after I read that, I think it's impossible to do what I want. Ehm....