Public Function CloseAllLoadForm()
On Error GoTo Err_CloseAllLoadForm
Dim frmLoad As AccessObject
For Each frmLoad In CurrentProject.AllForms
If (frmLoad.IsLoaded) And (frmLoad.Name <> "frmCurrent") And (frmLoad.Name <> "主面板") Then
DoCmd.Close acForm, frmLoad.Name
End If
Next
Exit_CloseAllLoadForm:
Exit Function
Err_CloseAllLoadForm:
MsgBox Err.Description
GoTo Exit_CloseAllLoadForm
End Function