|
-
Jun 30th, 2003, 11:03 PM
#1
Thread Starter
Junior Member
end, finalize, app.exit
could someone please list for me the order of operations a form takes when it is exited? which should you use to exit a form and kill all memory allocated to it?
thanks!
btw y can't you call me.finalize()?
-
Jul 1st, 2003, 02:00 AM
#2
-
Jul 1st, 2003, 03:03 PM
#3
Thread Starter
Junior Member
found order of events
Opening and closing a form
When you open a form, the following sequence of events occurs for the form:
Open Load Resize Activate Current
If there are no active controls on the form, the GotFocus event also occurs for the form after the Activate event but before the Current event.
When you close a form, the following sequence of events occurs for the form:
Unload Deactivate Close
If there are no active controls on the form, the LostFocus event also occurs for the form after the Unload event but before the Deactivate event.
Moving between forms
When you switch between two open forms, the Deactivate event occurs for the first form, and the Activate event occurs for the second form:
Deactivate (form1) Activate (form2)
The Deactivate event for a form also occurs when you switch from the form to another window in Microsoft Access. However, the Deactivate event doesn't occur when you switch to a dialog box, to a form whose PopUp property is set to Yes, or to a window in another application.
Note An Open event doesn't occur if you move to a form that is already open, even if you've moved to the form by carrying out an OpenForm action.
Working with data on a form
Form and control events occur as you move between records in the form and change data. For example, when you first open a form, the following sequence of events occurs:
Open (form) Load (form) Resize (form) Activate (form) Current (form) Enter (control) GotFocus (control)
Similarly, when you close a form, the following sequence of events occurs:
Exit (control) LostFocus (control) Unload (form) Deactivate (form) Close (form)
If you've changed data in a control, the BeforeUpdate and AfterUpdate events for both the control and the form occur before the Exit event for the control. For more information on the order of events for controls on forms, click .
Working with subforms
When you open a form containing a subform, the subform and its records are loaded before the main form. Thus, the events for the subform and its controls (such as Open, Current, Enter, and GotFocus) occur before the events for the form. The Activate event doesn't occur for subforms, however, so opening a main form triggers an Activate event only for the main form.
Similarly, when you close a form containing a subform, the subform and its records are unloaded after the form. The Deactivate event doesn't occur for subforms, so closing a main form triggers a Deactivate event only for the main form. The events for the controls, form, and subform occur in the following order:
Events for the subform's controls (such as Exit and LostFocus)
Events for the form's controls (including the subform control)
Events for the form (such as Deactivate and Close)
Events for the subform
-
Jul 1st, 2003, 03:24 PM
#4
Sleep mode
Safest way is to put your unwanted resources in the Main Protected sub of the form Dispose() . Then use
VB Code:
Me.Dispose(true)
Application.Exit()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|