SelectionChanged

Fires when the user selects a member’s label. The event procedure’s parameters provide the ID of the dimension and the member IDs of the previously selected and currently selected member labels.

Note:

This event also fires the first time that a dimension’s tab is selected.

Syntax

<HsvPOVSelection>_ SelectionChanged(lDim As Long, lPrevItemID As Long, lPrevParentID As Long, lNewItemID As Long, lNewParentID As Long)

Argument

Description

lDim

Long (ByVal). The ID of the member’s dimension. Dimension IDs are represented by the HFMConstants type library constants listed in Dimension ID Constants.

lPrevItemID

Long (ByVal). The member ID of the previously selected member.

lPrevParentID

Long (ByVal). The parent of the lPrevItemID argument’s member.

For dimensions other than Entity, or for Entity members without parents, the system passes the HFMConstants type library constant MEMBERNOTUSED to this argument. For information on this constant, see Dimension Member Constants.

lNewItemID

Long (ByVal). The member ID of the currently selected member.

lNewParentID

Long (ByVal). The parent of the lNewItemID argument’s member.

For dimensions other than Entity, or for Entity members without parents, the system passes the HFMConstants type library constant MEMBERNOTUSED to this argument.

Example

The following event procedure prints the labels of the previously and currently selected members to Visual Basic’s Immediate window. The IHsvTreeInfo method GetItemID is used to get the member labels from the member IDs passed to the event procedure.

Private Sub cFormPOV_SelectionChanged(ByVal lDim As Long, _
   ByVal lPrevItemID As Long, ByVal lPrevParentID As Long, _
   ByVal lNewItemID As Long, ByVal lNewParentID As Long)
Dim cTreeInfo As IHsvTreeInfo, cMetadata As HsvMetadata
Dim sPrevLabel As String, sNewLabel As String
Dim sPrevParLabel As String, sNewParLabel As String
'cSession is a previously set HsvSession instance
Set cMetadata = cSession.Metadata
Set cTreeInfo = cMetadata.Dimension(lDim)
cTreeInfo.GetLabel lPrevItemID, sPrevLabel
cTreeInfo.GetLabel lNewItemID, sNewLabel
Debug.Print "Previous label: " & sPrevLabel
Debug.Print "New label: " & sNewLabel
End Sub