marcostraf,
I tried implementing a collection of collections like you suggested. It works fine as long as I don't need to access anything inside the sub-collections by item number instead of key, or try to use the count method because data that I add to one sub-collection, gets added to all of them.
In my form initialization event I have:
Dim c As Collection
Set c = New Collection
Set colDeck = New Collection
Set colDiscard = New Collection
Set colPlayed = New Collection
colPlayed.Add c, "colTop"
colPlayed.Add c, "Col1"
colPlayed.Add c, "Col2"
colPlayed.Add c, "Col3"
colPlayed.Add c, "Col4"
colPlayed.Add c, "Col5"
colPlayed.Add c, "Col6"
colPlayed.Add c, "Col7"
And then in a cmd button click event I have:
Dim c As Collection
Dim labelname as String
Dim lbl As Card
Set c = colPlayed.Item("ColTop")
Set lbl = New Card
labelname = "lblColTop_Deck"
c.Add lbl, labelname
Set lbl = Nothing
At this point, all the sub-collections (ColTop, Col1, Col2, etc.) contain the data from the card "lbl"
How do I get the data to only be added to one of the sub-collections instead of all of them?
|