Returns the specified Control object.
Set variable = object.Item ( Index ) |
- Index
- Required. A Variant that specifies the name or index of the control.
Control Object
Index is a variant specifying the control to reference. It can be either the index or the name of the control. For example, if the variable objPage references a form page that contains a control named "lblInfo" that has an index of 2, the following two lines of code will yield the same result:
Set objControl = objPage.Controls.Item(2)
Set objControl = objPage.Controls.Item("lblInfo")
The Item method is the default method for the Controls collection. Therefore, the following two lines of code will yield the same result:
Set objControl = objPage.Controls.Item("lblInfo")
Set objControl = objPage.Controls("lblInfo")
Set objControl = objPage.Controls.Item(2)
Set objControl = objPage.Controls.Item("lblInfo")
The Item method is the default method for the Controls collection. Therefore, the following two lines of code will yield the same result:
Set objControl = objPage.Controls.Item("lblInfo")
Set objControl = objPage.Controls("lblInfo")