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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set nothing form1

sal21

Programmer
Apr 26, 2004
462
IT
In a form1 have a treeview, with big numbers of child, children and node.
When i exit to the from1, (i'm on test) i use:

Private Sub Command1_Click()

Set Form1 = Nothing
Unload Me

End Sub

to exit and return to the ide, and have free access to the ide, the opertion , take a vry, very time!
 
I think it would speed up if you reverse the Unload and set to Nothing. Really cannot unload something that is set to nothing.
 
Ok
Example code to close correctly the form?
 
Rich (BB code):
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Set Form1 = Nothing
End Sub
 
I dont understand where i put this code in command button to close the form!
 
You don't "put this code in command button".
In the cmd you just need:
Unload Me
and the rest (setting form to nothing) is done in
Private Sub Form_QueryUnload
 
>Set Form1 = Nothing

You generally don't need to bother with this, since it happens when the form goes out of scope (which will happen when you Unload)
 

Part and Inventory Search

Sponsor

Back
Top