Destroying Variables

amerfeld

Registered User.
Local time
Today, 08:40
Joined
Aug 17, 2004
Messages
58
Quick question: When is it necessary to destroy variables? Are public and private variables treated the same? I am using Access 2000. (I may have inadvertently posted this twice).
Thanks for any help.
 
I know some of you may still be sleepy from all the turkey on Thanksgiving, but I know lots of you must know the answer to this. ;)
 
A global variable is active the duration of the database being open.
Procedure variable are active the duration of the procedure.
Form variables are active the duration of the form.

Basically.
 
The custom is to explicitly destroy object variables you Set rather than assume memory will be freed up when the variable goes out of scope. If you Set it then Set = Nothing after you are done with it.
 

Users who are viewing this thread

Back
Top Bottom