因此最好是自己编写一个关闭子程序:
Public Sub Shutdown(Optional ByVal Force As Boolean = False)
Dim I As Long
On Error Resume Next
For I = Forms.Count - 1 to 0 Step -1
Unload Forms(I) ' Triggers QueryUnload and Form_Unload
' If we aren't in Force mode and the
' unload failed, stop the shutdown.
If Not Force Then
If Forms.Count > I then
Exit Sub
End If
End If
Next I
' If we are in Force mode OR all
' forms unloaded, close all files.
If Force Or (Forms.Count = 0) Then Close
' If we are in Force mode AND all
' forms not unloaded, end.
If Force Or (Forms.Count > 0) Then End
End Sub
评论 {{userinfo.comments}}
{{child.content}}
{{question.question}}
提交