We need you!

We're working hard on the next version of Developer Fusion. Let us know what you think we should be up to!

Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 13,899 times

Related Categories

Unloading All Forms - Unloading All Forms

Unloading All Forms

Put this routine in a code module and call it in the exit section of your program

Public Sub UnloadAll()
'------------------------------------------------------------
' Procedure: UnloadAll
' Purpose: To Unload all forms once the program finishes
' Input parameters: None
'
' Output parameters:None
'
' Return Value:None
' Author: PETER PILUK
' Date: 06/11/00
'------------------------------------------------------------


   Dim f As Integer
   f = Forms.Count
   Do While f > 0
       Unload Forms(f - 1)
       If f = Forms.Count Then Exit Do
       f = f - 1
   Loop
End Sub

Comments

  • Re: [1014] Unloading All Forms

    Posted by BobL on 26 Feb 2007

    It probably is a good idea to set the unloaded form to Nothing as in the following:


    Public Sub UnloadAllForms()
       Dim Form As Form
          For Each F...

  • Posted by domdm on 18 Jul 2002

    yeah that code is better, its the code i use when unloading all the forms



    [red][b]Dom[/b][/red]
    [url="http://www.ComputerGuides.net"][b][b][orange]ComputerGuides[/orange][/b][/url]

  • Better Code for Form closing

    Posted by sachiel on 04 Jan 2002

    Dim NewForm As Form
    For Each NewForm In Forms
    If Not (NewForm.name = "MDIStartup" Or NewForm.name = "frmLogOff") Then
    Unload NewForm
    End If
    Next

    With th...