VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Close all forms within a project.

by Mike (7 Submissions)
Category: VB function enhancement
Compatability: Visual Basic 5.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

Add this code to a module and simply use CloseAll to unload all forms in your project.

Side Effects
None that I know off, I haven't had any problems yet... a decrease in use of Unload and End?

Rate Close all forms within a project.

Sub CloseAll()
On Error Resume Next
Dim intFrmNum As Integer
 intFrmNum = Forms.Count
Do Until intFrmNum = 0
 Unload Forms(intFrmNum - 1)
 intFrmNum = intFrmNum - 1
Loop
End Sub

Download this snippet    Add to My Saved Code

Close all forms within a project. Comments

No comments have been posted about Close all forms within a project.. Why not be the first to post a comment about Close all forms within a project..

Post your comment

Subject:
Message:
0/1000 characters