我有一个包含许多子表单(和子子表单)的主表单。我想在我的主子表单上有一个按钮,它将每个子表单从启用=真切换到启用=假。是否可以在不必具体参考每个子表单的情况下执行此操作?也许类似于:对于 frmMainForm 的每个子窗体...?
是的,您可以循环控制:
For Each Control In Me.Controls
If Control.ControlType = acSubform Then
' Do something with this subform control.
End If
Next
Run Code Online (Sandbox Code Playgroud)