Loops through the forms object and closes all open databases and/or unloads the forms.
Loops through the forms object and closes all open databases and/or unloads the forms.
Rate Loops through the forms object and closes all open databases and/or unloads the forms.
(1(1 Vote))
Dim x, y As Long
' Close the databases and forms
RestartList:
For x = 0 To Forms.Count - 1
If LCase(Left(Forms(x).Name, 7)) <> "frmmain" Then
If Forms(x).MDIChild = True Then
For y = 0 To Forms(x).Controls.Count - 1
If Left(Forms(x).Controls(y).Name, 3) = "dat" Then
Forms(x).Controls(y).Database.Close
ElseIf Left(Forms(x).Controls(y).Name, 3) = "ado" Then
Forms(x).Controls(y).Recordset.Close
End If
doevents
Next y
If bCloseWindows = True Then
Unload Forms(x)
GoTo RestartList
End If
End If
End If
DoEvents
Next x
End Sub
Loops through the forms object and closes all open databases and/or unloads the forms. Comments
No comments yet — be the first to post one!
Post a Comment