当数组元素是控件时,如何迭代数组?

时间:2017-07-21 14:50:41

标签: arrays vba ms-access for-loop ms-access-2016

我需要遍历一组控件名称来更改其sendRawEmail()值。

这是我尝试过的:

TabIndex

...但这给了我错误:Dim ctls As Variant Dim i As Variant ctls = Array("Text2") For Each i In ctls i.TabIndex = 1 Next 。如何将数组元素识别为对象?

1 个答案:

答案 0 :(得分:0)

Dim ctrl As Control

For Each ctrl In Me.Controls

    ctrl.TabIndex = 1

Next