GetMember

Returns the member ID of the currently selected member for a given dimension when the tab is configured for single-select mode.

Note:

In multi-select mode, GetMember returns the ID of the selected member label regardless of whether that member’s check box is selected. If a tag is configured for multi-select mode, get the selected members with GetCheckedItems.

Syntax

<HsvPOVSelection>.GetMember lDim, plItemID, plParentID

Argument

Description

lDim

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

plItemID

Long. Returns the member ID of the selected member.

Tip:

To get a member’s label, pass this ID to the IHsvTreeInfo method GetLabel.

plParentID

Long. For the Entity dimension, returns the member ID of the selected member’s parent.

If the member has no parent, or belongs to a dimension other than Entity, the HFMConstants type library constant MEMBERNOTUSED is returned. For information on this constant, see Dimension Member Constants.

Example

The following function returns the name of the member that is selected on a given dimension’s tab. The name is obtained by passing the member ID to IHsvTreeInfo.GetLabel.

Function getSelMemName(lDim As Long) As String
Dim lId As Long, lParId As Long, sMem As String
Dim cTreeInfo As IHsvTreeInfo, sPar As String
'g_cMetadata is a previously set HsvMetadata instance
Set cTreeInfo = g_cMetadata.Dimension(lDim)
'cFormPOV represents an initialized HsvPOVSelection control
cFormPOV.GetMember lDim, lId, lParId
cTreeInfo.GetLabel lId, sMem
If lParId > -1 Then
    'concatenate Parent name
    cTreeInfo.GetLabel lParId, sPar
    getSelMemName = sPar & "." & sMem
Else
    getSelMemName = sMem
End If
End Function