Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help in closing or unloading forms 1

Status
Not open for further replies.

Micash

Programmer
Dec 11, 2000
54
Could someone please tell me how to effectively ensure that all my forms are unloaded when I unload my front end/main form in a log off procedure?
Much obliged - Micash
 
Put this in the Form unload event in your front end/main form .


Dim frm As Form
For Each frm In Forms()
If frm.Name <> Me.Name Then
Unload frm
End If
Next
Unload Me

David Paulson


 
Don't forget to set them to 'Nothing':

Dim frm As Form
For Each frm In Forms()
If frm.Name <> Me.Name Then
Unload frm
SET FRM=NOTHING
End If
Next
Unload Me
SET MAINFORM_NAME=NOTHING
Marc
 
Set form1 = NOTHING
Todd Norris
Hope this helps !
 
I have a question. Will this work when not using MDI forms.

Delton Phillips.
New Generation Solutions
ngs@cwjamaica.com
deltonphillips@hotmail.com

New Thinking...Better results.

 
dellyjm,

Yes, it will work because the Forms collection is an instrinsic collection that contains all of the 'currently loaded' forms. It is not limited to MDI applications.

Madlarry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top