Function IsLoaded(ByVal strFormName As String) As Boolean
' 如果指定窗体在窗体视图或数据表视图中打开,返回 True。
Dim oAccessObject As AccessObject
Set oAccessObject = CurrentProject.AllForms(strFormName)
If oAccessObject.IsLoaded Then
If oAccessObject.CurrentView <> acCurViewDesign Then
IsLoaded = True
End If
End If
End Function