Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Help, One form Closes another Form when closing itself...

It happens that paul cain formulated :
For the sake of other users with 1 form closing the parent form.... I have
had this same problem with vba Excel, my program is driven entirely from my
MainForm which is modeless but subsequent forms opened from it were modal. I
have had an intermittent problem with MainForm closing when the modal form
closes. MainForm closes (or disappears, I am not really sure what has
happened to it) without even triggering the QueryClose event. By
intermittent, I mean some code has the problem, some doesn't, and I do not
know what the significant difference is between the codes except perhaps that
the code that does crash is usually under development still, not fully
debugged. I have only found 1 fix as mentioned in this discussion, and that
is to make all forms modeless. It is not possible to simply interchange them
from modal to modeless on the run. However, it is possible to add
MainForm.Enabled = False when I open the secondary forms to prevent the user
changing the data in MainForm, then reset it True after the second form is
unloaded. In practice, I had to reset it within a QueryClose sub in case the
user presses X box to close.


I'm inclined to agree with Tom Ogilvy's suggestion to hide userform1
while userform2 is in use, then unhide userform1 when code resumes.
That concept works for me!

What you might want to pay attention to is whether ScreenUpdating is
turned off anywhere, AND/OR whether a DoEvents function is needed.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing Form and prevention C_Ascheman[_2_] Excel Programming 3 February 23rd 07 04:51 PM
Closing a Form Mike Excel Discussion (Misc queries) 2 March 14th 06 01:09 PM
form closing with the X raw[_15_] Excel Programming 2 December 22nd 05 12:40 AM
HELP! - Closing form Alex J Excel Programming 1 September 17th 04 01:37 AM
HELP! - Closing form Norman Jones Excel Programming 0 September 16th 04 03:21 AM


All times are GMT +1. The time now is 03:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"