Use the QueryUnload event routine to take whatever action you want
when the user closes the form by clicking the "X" button on the form.
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
every form has this event handler--read the VB help file for the
QueryUnload event.
On Sat, 14 Feb 2004 23:13:49 -0800, "feng"
<an*******@discussions.microsoft.com> wrote:
I need to test if the form is closing because of user's
clicking on the "x" button, instead of other buttons, such
as my "Exit" button, on my form.
I would like to test this in my form's Closing event
handler, but I don't know how to do this.
Can someone show me how?
Thanks.