Access/VBA Library

GetKeyFromIndex

Private function which returns a String containing the name of the key. This is the value after the first dot in index.

Syntax

GetKeyFromIndex( index )
Parameters
Name Type Description
index String Required. Pair of section and key, separated by a dot.
Return value

String : Name of the key.

Code
Private Function GetKeyFromIndex(index As String) As String
    Dim pos As Integer
    
    pos = InStr(index, ".")
    If pos = 0 Then
        GetKeyFromIndex = index
    Else
        GetKeyFromIndex = Mid$(index, pos + 1)
    End If
End Function