I'm struggling with this, I'm doing some stuff in Access with VBA and I need to dynamically create N collections/lists/arrays of records and add them to my dictionary.
//Some pseudo code
Dim dict as object
Set dict = CreateObject("Scripting.Dictionary")
for record in myRecordSetObject
if dict.exists(keyfromrecord)
dict(keyfromrecord) = array.add(record)
else
newarray = [record]
dict.add key:="keyfromrecord" item:=array
If it can't be done I might just do a string of primary keys and grow it as needed, then call string split.
Edit
So I have my records and I need to divide them into subgroups based on a few common fields that they may or may not share. If two records have the same pieces of information in these select fields they're in a subgroup. A subgroup may have 1 - N records.
Instead of getting all possible combinations and filtering my query I want to create a dictionary that defines it's key as a string generated from these fields. If a key exists then there's a member of that subgroup, if it doesn't it's a new subgroup.
The value was going to be an array of records.
Afterwards I was going to go through my dictionary and do stuff with these records.
Field1 Field2 Field3 Field4
Fruit Skinned Sliced Baked
Apples True True True
Bananas True True True
Oranges True False False
Using this example above subgroup would be when Field2,3 and 4 have the same value. (Apples, Bananas) and the other would be (Oranges)
I want a dictionary with Key being
dictionary{
"True-True-True": [Apples, Bananas],
"True-False-True": [Oranges]
}



table1withfield1field2andfield3if bothfield1andfield2you want to add fields 1 to 3 to a dictionary with a key offield1_field2?field 1 row 1 value=field 1 row 2 valueaddrow1androw2