使用下面的代码,可以获得窗体上所有的控件的名称:
Dim tCtrl As Control For Each tCtrl In Me.Controls Debug.Print tCtrl.Name Next tCtrl