When exit my App it still remainding in the Task List.
Any idea about it?
Printable View
When exit my App it still remainding in the Task List.
Any idea about it?
how are you ending it?
use END
if your using that then it should terminate it
Sorry, but the MSDN Library says so itself :rolleyes:.
Use this code:
Code:Private Sub UnloadAllForms()
Dim Form As Form
For Each Form In Forms
Unload Form
Set Form = Nothing
Next Form
End Sub
so we dont use END at all or before or after unloading all?
End stops execution right then and there, not allowing for any "housekeeping", if you do use end, throw it in the form query unload event, after matheews code.
Well, the END statement can be used. But in the MSDN Library, it says, "Never required by itself" or something like that. End won't end the program, resources that your program is using will still be there. The UNLOAD statement will clear up any resources used by the form and unload the form.
Set Form = Nothing
..can be used as well.
And as Lethal said, End can be put after all that code.
I usually do something like:Code:Private Sub UnloadAllForms()
Dim Form As Form
For Each Form In Forms
Unload Form
Set Form = Nothing
Next Form
End
End Sub
Unload Me
Set Form1 = Nothing
End
I like to use them all :rolleyes:.
But never use End by itself!
Read into it what you will. What I think it says is DON'T USE IT!Quote:
End Terminates execution immediately. Never required by itself but may be placed anywhere in a procedure to end code execution, close files opened with the Open statement and to clearvariables.
End Function Required to end a Function statement.
End If Required to end a block If…Then…Else statement.
End Property Required to end a Property Let, Property Get, or Property Set procedure.
End Select Required to end a Select Case statement.
End Sub Required to end a Sub statement.
End Type Required to end auser-defined type definition (Type statement).
End With Required to end a With statement.