by Programming Innovations (7 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 19th August 2002
Date Added: Mon 8th February 2021
Rating:
(1 Votes)
Loops through the forms object and closes all open databases and/or unloads the forms.
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
No comments have been posted about Loops through the forms object and closes all open databases and/or unloads the forms.. Why not be the first to post a comment about Loops through the forms object and closes all open databases and/or unloads the forms..