Form Unload Event Questions

ZaCkOX
10-17-2009, 10:18 PM
Do I really have to set mshflexgrid's .datasources = nothing and some other stuff... or doesn't unloading the form already unload all the resources I am using?

I have

set formname = nothing

in the form unload event, do I really need anything else unless it's public?

I guess what I am asking is what should I clear in memory and not? Not much point putting code there if it is cleared automatically in the unloading of the form.

vb5prgrmr
10-18-2009, 06:42 AM
Unloading a form only unloads the graphical elements of the form (while the program is still running)...

Unload Me

So any objects within the form that are declared as public are still accessible. This includes recordsets, connections, and so on.



Good Luck

ZaCkOX
10-18-2009, 11:27 AM
Well I'm glad you said that, I have some public subs in a form. Do I have to worry about that... might be a stupid question.

So a mshflexgrid on my form, the datasource and the mshflexgrid are unloaded, so I don't need to code set mshflexgrid.datasource = nothing right? Because the graphic object is unloaded?

vb5prgrmr
10-18-2009, 10:56 PM
for a better explanation that I had recently on this subject see this thread...

http://www.tek-tips.com/viewthread.cfm?qid=1570150&page=2

Which you will learn that when you do Unload Me, only the graphical elements are unloaded along with any data contained by those graphical elements while all the code is still accessible.



Good Luck

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum