About Loading and Unloading Forms (VBA)
There may be times when you want to load a form into memory during runtime, but not
show the form. You may choose to do this to better control when the load time occurs
in your application, or when you need programmatic access to the form but do not want
to display the form to the user.
To load a form, but not display it, use the VBA Load method. The Show method can then be used to make the form visible at the appropriate time in your
application’s execution. Remember, the user cannot interact with your form until it
is visible.
If the Show method is called and the form has not been loaded, it will be loaded automatically.
There may also be times when you will want to unload a form specifically. Unloading
a form removes that form from memory and all the memory associated with the form is
reclaimed. Until the form is loaded again by using either the Load or Show method, a user cannot interact with the form, and the form cannot be manipulated
programmatically. You may choose to unload a form when you know the form will not
be used again in the application and you want to reclaim the memory.
The Hide method does not perform an unload. If your application ends and a form has
not been unloaded, it will be unloaded automatically. The following table compares
the VBA Show, Hide, Load, and Unload methods:
VBA Show, Hide, Load, and Unload methods | |
---|---|
Method | Use |
Show | Displays a form. If the form has not been loaded, it is loaded automatically. |
Hide | Hides a form. The form is not unloaded from memory. |
Load | Loads a form into memory but does not display it. |
Unload | Unloads a form from memory. This can be done explicitly from the Unload method, or automatically at the termination of the application. |
ere may be times when you want to load a form into memory during runtime, but not show the form. You may choose to do this to better control when the load …VBA reference Object model Form Object …. By running a macro or an event procedure when a form's Unload event occurs, you can verify that the form …form from your main code body, and if you unload it they won't be available. Instead, keep …forms byform I run Load myForm myForm.Show Unload myForm The form has an OK Button and a Cancel button which both hide the form …load or unload this object This … this form? I appreciate any input you could provide. — VBA Fun.Load Form"? The app's "Auto_Open" event? And "Unload Form"? In the app's "Auto_Close" or somewhere …form.show or load form in VBA access? if it is not. Could you please show me how to load a form. Thanks, Joe.Unload Me More info on this page http://support .microsoft.com/default.aspx?scid=kb;EN-US;829070 —