When I use the:
Unload FormName
method, the form disappears, but if I try to delete the program the computer says that the program is in use.
Am I not using the correct command to close the program?
Printable View
When I use the:
Unload FormName
method, the form disappears, but if I try to delete the program the computer says that the program is in use.
Am I not using the correct command to close the program?
Use the End command to close a program.
Code:
'use this in your unload event
Dim Form As Form
For Each Form In Forms
Unload Form
Set Form = Nothing
Next Form
The difference between the 2 is Unload will trigger the unload events (QueryUnload, Unload and Terminate), and End will not.
and it's also a good habit to set your
objects = nothing!