If you use a MDI form, then this needs to be unloaded:
Unload myMDI
In the MDI's QueryUnload event, use a loop to unload all child forms:
Dim frm As VB.Form
For Each frm In VB.Forms
If Not TypeOf frm Is MDIForm Then
Unload frm
End If
Next frm
Then, make sure you also unload any designers (DataReport, Crystal Reports, etc) and Close/destroy any objects (Such as class objects, Connections, etc - also you need to explicitly close and destroy these in each form's Unload event, if they were declared at form module level)
If Not Conn Is Nothing Then
If Conn.State = adStateOpen Then Conn.Close
Set Conn = Nothing
End If
Once everything is Unloaded and Destroyed, then you should be OK.
Make sure you set you forms to nothing
set frm = nothing
after you unload it.
Also, if your project references activeX dlls or control projects that have forms, VB will not unload your app depending on a few different conditions (formloaded not but visible, etc..). I cant seem to find the MSDN article about it though....try a search if it sounds like your issue.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.