
Collection of Collections?
Baus mumbled incoherently:
Quote:
> Is it possible to create a collection whose members themselves consist
> of collections?
Yes, paste the code below into a form with a single command button, it's
fairly self-expanatory.
Option Explicit
' "Top-level collection"
Private nCol As Collection
Private Sub Command1_Click()
MsgBox nCol("nCol2").Item("Key2")
End Sub
Private Sub Form_Load()
Dim nCol2 As Collection
Set nCol = New Collection
Set nCol2 = New Collection
nCol2.Add "Item1", "Key1"
nCol2.Add "Item2", "Key2"
nCol.Add nCol2, "nCol2"
End Sub
-Stef