
04-08-2004, 02:21 PM
|
 |
Junior Contributor
|
|
Join Date: Jul 2000
Location: Hamilton, ON, Canada
Posts: 297
|
|
Use the QueryUnload event in your main form. It will tell you the UnloadMode. From the help:
Code:
vbFormControlMenu 0 The user chose the Close command from the Control menu on the form.
vbFormCode 1 The Unload statement is invoked from code.
vbAppWindows 2 The current Microsoft Windows operating environment session is ending.
vbAppTaskManager 3 The Microsoft Windows Task Manager is closing the application.
vbFormMDIForm 4 An MDI child form is closing because the MDI form is closing.
vbFormOwner 5 A form is closing because its owner is closing.
|
|