Collections. A collection is a way of grouping a set of related items. Properties and Methods a Collection. How is a Collection stored?. A Collection object stores each item in a Variant. The list of things you can add to a Collection object is the
A collection is a way of grouping a set of related items.
Properties and Methods a Collection
Use the Item method to retrieve specific items from a collection.
The syntax is:
[Set] variable = object.Item(index)
Set woCurrent = colWorkOrders.Item(3)
Set woCurrent = colWorkOrders.Item("W017493")
Item is the default method
Set woCurrent = colWorkOrders(3)
Set woCurrent = colWorkOrders ("W017493")
colWorkOrders("W017493").Priority = 3
Creating your own collection class
The most robust way to implement a collection is by making it a class module .
Create a class that is a wrapper around a collection.
The student/courses project demonstrates this.
colCourses is a container for
objects of type clsCourse