Form.PivotTableChange event (Access)

Occurs whenever the specified PivotTable view field, field set, or total is added or deleted.


expression.PivotTableChange (Reason)

expression A variable that represents a Form object.


Name Required/Optional Data type Description
Reason Required Long A PivotTableReasonEnum constant that indicates how the PivotTable list changed.


The following example demonstrates the syntax for a subroutine that traps the PivotTableChange event.

Private Sub Form_PivotTableChange(Reason As Long) 
 Select Case Reason 
 Case OWC.plPivotTableReasonTotalAdded 
 MsgBox "A total was added!" 
 Case OWC.plPivotTableReasonFieldSetAdded 
 MsgBox "A field set was added!" 
 Case OWC.plPivotTableReasonFieldAdded 
 MsgBox "A field was added!" 
 End Select 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.