Office中国论坛/Access中国论坛

标题: 关闭所有窗体 [打印本页]

作者: ywfqd    时间: 2006-8-17 23:44
标题: 关闭所有窗体
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
作者: tz-chf    时间: 2006-8-18 00:18
没有打开的就不用关闭了,所以currentproject.forms




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3