from VBA help:
Add Method
Adds a member to a Collection object.
Syntax
object.Add item, key, before, after
The Add method syntax has the following object qualifier and named arguments:
Part Description
object Required. An object expression that evaluates to an object in the Applies To list.
item Required. An expression of any type that specifies the member to add to the collection.
key Optional. A unique string expression that specifies a key string that can be used, instead of a positional index, to access a member of the collection.
before Optional. An expression that specifies a relative position in the collection. The member to be added is placed in the collection before the member identified by the before argument. If a numeric expression, before must be a number from 1 to the value of the collection's Count property. If a string expression, before must correspond to the key specified when the member being referred to was added to the collection. You can specify a before position or an after position, but not both.
after Optional. An expression that specifies a relative position in the collection. The member to be added is placed in the collection after the member identified by the after argument. If numeric, after must be a number from 1 to the value of the collection's Count property. If a string, after must correspond to the key specified when the member referred to was added to the collection. You can specify a before position or an after position, but not both.
Remove Method
Removes a member from a Collection object.
Syntax
object.Remove index
The Remove method syntax has the following object qualifier and part:
Part Description
object Required. An object expression that evaluates to an object in the Applies To list.
index Required. An expression that specifies the position of a member of the collection. If a numeric expression, index must be a number from 1 to the value of the collection's Count property. If a string expression, index must correspond to the key argument specified when the member referred to was added to the collection.
Item Method
Returns a specific member of a Collection object either by position or by key.
Syntax
object.Item(index)
The Item method syntax has the following object qualifier and part:
Part Description
object Required. An object expression that evaluates to an object in the Applies To list.
index Required. An expression that specifies the position of a member of the collection. If a numeric expression, index must be a number from 1 to the value of the collection's Count property. If a string expression, index must correspond to the key argument specified when the member referred to was added to the collection.
Main Topics
Browse All Topics





by: thenelsonPosted on 2009-11-04 at 11:20:26ID: 25742842
Use the add and remove functions:
Dim colCheckBox As New Collection
colCheckBox.Add CLng(rst!ID), CStr(rst!ID)
colCheckBox.Remove (CStr(Me.ID))
Then to Access the item:
colCheckBox(CStr(vID))