Hi


VB actually keeps forms around in memory - even if you explicitly 'unload' them - this is due to any static variables or routines you may have.


If you want to remove them from memory completely, use the following syntax :


Unload frmWhatever

Set frmWhatever = Nothing ' this releases the memory Code Segment


Also, if you are referencing multiple instances of forms in your code, make sure that you **Never** do a 'Dim frmMine As New frmWhatever' - this will load the form (or check if it's loaded) on each reference to the variable, also, once you've unloaded the form - it will load again on the next property access -


eg.


Dim frmMine As New frmWhatever


frmMine.Show


Unload frmMine

Set frmMine = Nothing ' Won't set it to nothing


frmMin.Show ' will reload it again


Regards


Chris Eastwood


CodeGuru - the website for developers

http://www.codeguru.com/vb