I think there is a world market for maybe five computers.
- Thomas Watson, Chairman of IBM 1943
Instead of Using End
Six lines of code that will, under most circumstances, release all of the memory used by all of the forms included in your application. Remember that Forms is the name of a Collection but a Form is an Object. This will not necessarily release memory dynamically allocated for variables. Remember that the Form_Unload Event of the a form is a good place to do any cleanup needed at the end of a program. CleanExit() will trigger the Form_Unload event of each form.
Public Sub CleanExit() Dim frmForm As Form For Each frmForm In Forms Unload frmForm Set frmForm = Nothing Next ' frmForm End Sub
No Comments for this page.
You Must be
Rating of 5 (
Login to Rate This Code
Login to Post a Comment
Read more by this author
RGB Color Fader
Cut and Paste
Combo Box Colors
"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.