| BindingCollection Remove.Method (VB6) |
Named Arguments
Yes
Syntax
oBindingColl.Remove(Binding)
oBindingColl
Use: Required
Data Type: BindingCollection object
An object reference that returns a BindingCollection object.
Binding
Use: Required
Data Type: Binding object
A reference to a binding object in the BindingCollection.
Description
Removes a previously added Binding object from the BindingCollection object.
Programming Tips and Gotchas
Unlike most other Remove methods attached to collections in VBA, the Binding-Collection's Remove method's parameter is a reference to the object being removed from the collection.
Example
In this short snippet, we access the Item method using the key assigned to the Binding object we want to remove. The method call assigns a reference to the Binding object to be removed to our local oBind object variable, which can then be passed to the Remove method. We then set the Bind object variable to Nothing afterwards. The For Each...Next statement proves that the object has been removed.
Set oBind = obcAuthors.Item("address")
obcAuthors.Remove oBind
Set oBind = Nothing
For Each oBind In obcAuthors
Debug.Print oBind.Key
Next
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access