For Each aoj In CurrentProject.AllForms
If aoj.name <> "frmMain" Then '关闭除主窗体外的所有窗体
Docmd.Close acform, aoj.name
End If
Next
也可使用类似的方法来做其它事情,如把窗体全部更换为英语,或法语等语言
For Each aoj In CurrentProject.AllForms
If aoj.name <> "frmZstmSetLang" Then
Me.lblPregress.Caption = "Processing Form:" & aoj.name
gt_GenLangPackToTable 2052, "Form", aoj.name
DoEvents
End If
Next