|
-
Aug 11th, 2000, 10:05 AM
#1
Thread Starter
New Member
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
-
Aug 11th, 2000, 11:07 AM
#2
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,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|