Determine the Name of the GroupBy Column
Note
Indexing Service is no longer supported as of Windows XP and is unavailable for use as of Windows 8. Instead, use Windows Search for client side search and Microsoft Search Server Express for server side search.
This code segment iterates through all the fields of the objRS_Parent Recordset object and concatenates the names of the columns in the parent recordset, excluding any chaptered columns.
strGroupBy = ""
For intI = 0 to objRS_Parent.Fields.Count - 1
If objRS_Parent(intI).Name <> "Chapter" Then
If strGroupBy <> "" Then
strGroupBy = strGroupBy & " " & objRS_Parent(intI).Name
Else
strGroupBy = objRS_Parent(intI).Name
End If
End If
Next
For the properties set in this example, the strGroupBy variable is "DIRECTORY".