Here's a question for you VB gurus.
I'm using a Collection. When adding Items into my Collection, I'm adding values from a Recordset. I'm assigning a field from the Recordset as a string into the "Item", and I'm assigning the record's key into the collection.Item's "key" as a string.
Here's the records I'm making the assignment with... (there's only two fields with the first being the ID or Key for the record)
2 Fred
25 Bob
30 Joe
I use this statement to add each Item into my Collection (the name of my Recordset is "rsUtility"
Collection.add Cstr(rsUtility!Name), Cstr(rsUtility!ID)
Here's my question... when I reference the Collection's Item like this...
Collection(Cstr(rsUtility!ID))
...what will I get back? Will I get the Item "Fred" because the Item's "key" for "Fred" is 2 and I'm giving the Index a string?
...or will I get the second Item in the Collection (which in this case would be "Bob"
?
I'm using a Collection. When adding Items into my Collection, I'm adding values from a Recordset. I'm assigning a field from the Recordset as a string into the "Item", and I'm assigning the record's key into the collection.Item's "key" as a string.
Here's the records I'm making the assignment with... (there's only two fields with the first being the ID or Key for the record)
2 Fred
25 Bob
30 Joe
I use this statement to add each Item into my Collection (the name of my Recordset is "rsUtility"
Collection.add Cstr(rsUtility!Name), Cstr(rsUtility!ID)
Here's my question... when I reference the Collection's Item like this...
Collection(Cstr(rsUtility!ID))
...what will I get back? Will I get the Item "Fred" because the Item's "key" for "Fred" is 2 and I'm giving the Index a string?
...or will I get the second Item in the Collection (which in this case would be "Bob"