我正在使用 Collection 来存储 Type 的变量,SubForm
但是当我去检索对象时,它是 type Controls
。有人能告诉我这是为什么吗?
For Each ctl In Me.controls
Select Case ctl.ControlType
Case acSubform
Debug.Print "subform: " & TypeName(ctl)
If (ctl.Name = "a" Or ctl.Name = "b") Then
frmCollection.Add (ctl)
End If
End Select
Next
For Each frm In frmCollection
Debug.Print "Control: " & TypeName(frm)
Next