What reasons could there be if the app is still in the list when u ctrl+alt+del, when its suppose 2 unload, I've used the end command ?
Thanks
Printable View
What reasons could there be if the app is still in the list when u ctrl+alt+del, when its suppose 2 unload, I've used the end command ?
Thanks
Don't use end.It is a bad programming habit.Use
Instead.End just forces the app to close without freeing up memory.Code:Unload Form
In some cases you can use End:
Code:Private Sub Form_Unload(Cancel As Integer)
Dim frm As Form
For Each frm In Forms
Unload frm
Set frm = Nothing
Next
End
End Sub
Or, another use is:
another use for End, for you can't unload a module and just Exit Sub is too complicated.Code:'Module Code
Sub Main()
...
Proc1
...
End Sub
Sub Proc1()
...
Proc2
...
End Sub
.
.
.
Sub Procn()
...
End
...
...
End Sub
This is the best way to go.Quote:
Originally posted by Jop
In some cases you can use End:
Code:Private Sub Form_Unload(Cancel As Integer)
Dim frm As Form
For Each frm In Forms
Unload frm
Set frm = Nothing
Next
End
End Sub
Set Form = Nothing - Clears up any resources a form is using.
Unload Me - Unloads a form or control from memory.
End - Terminates execution. Never required by itself but may be placed anywhere in a procedure to close files opened with the Open statement and to clear variables.
Notice: See the End statement, never use it by itself (in Bold).