Collection Object.
Returns the number of members in a collection. Not available at design time; read-only at run time.
object.Count
The object qualifier is an object expression that evaluates to an object in the Applies To list.
Add Method, Item Method, Remove Method.
This example uses the Collection object’s Count property to specify how many iterations are required to remove all the elements of the collection called MyClasses. When collections are numerically indexed, the base is 1 by default. Since collections are reindexed automatically when a removal is made, the following code removes the first member on each iteration.
Dim NumNum = 1 To MyClasses.Count ' Remove name from the collection. MyClasses.Remove 1 ' Default collection numeric indexes ' begin at 1.
See also the Count property (Microsoft Access) example.