469,603 Members | 2,110 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,603 developers. It's quick & easy.

closing form / X Button

469 256MB
hi, is it possible to run a code when the form is closed.

What i mean is... when the user clicks the x on the top right to close the form, can i run code before the form closes?

i have done something simular before... when the user clicks the x button a dialog box appears says "are you sure"... "yes" or "No"

But i forgot how i did it.

please help

Thanks James
Sep 21 '07 #1
1 1233
8,435 Expert 8TB
The details will vary a bit between versions of VB, but you probably want to place your code in the Unload or QueryUnload event procedures. One important difference is that in the QueryUnload, you can refuse to let the form be unloaded, by setting the Cancel parameter to True.
Sep 22 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Peter yeshew | last post: by
8 posts views Thread by Mickey Swanson | last post: by
10 posts views Thread by Ricky W. Hunt | last post: by
2 posts views Thread by N! Xau | last post: by
14 posts views Thread by =?Utf-8?B?UHVjY2E=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.