-
I am trying to write a collection where I can store a product id and a quantity together. However both the product id and quantity may appear more than once in the collection and so neither can be set as the key. Is there another kind of collection I could use which will relate the two peices of information to each other and allow me to access it by querying on the product id?
regards,
Ayla
-
You can use array of User Defined Type:
Code:
Option Explicit
Private Type udtProductOrder
lngProductID As Long
intQuatity As Integer
End Type
Private tProductOrders() 'array of product orders
When you populate tProductOrders array with your data, the Index of each array element would be a unique criteria to identify each product, i.e
MsgBox tProductOrders(0).lngProductId & vbTab & tProductOrders(0).intQuantity
Regards,
Regards,