Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2005

Tip: Looking for answers? Try searching our database.

Switching between userforms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg Maxey - 15 Oct 2005 08:01 GMT
I have a userform that is modeless so I can swith to and from the form and
the activedocument.  In this userform there is a sub-form (a form that is
displayed based on actions in the main form).  For some reason when ever
this form is used and then closed my main form then closes also when the
code steps though to completion.  No where in my code do I have .hide
statement for the main form.  The unload mainform statement is a command
button statement of the main form.

I tried .hide the mainform before opening the subform and then running a
.show vbModeless in the exit statement of the subform.  This didn't work.
The only way I can keep the mainform open after executing code in the sub
form is with a .show (without vbModeless).  This is a problem as I need to
move back and forth between the main form and document after executing the
subform.

Thanks.

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

Tony Jollans - 15 Oct 2005 11:46 GMT
I'm not entirely sure what you mean by a sub-form (VBA Userforms are not
like Access Forms). Do you somehow have the subform embedded as a control in
the main form or is it simply a second userform that you (are trying to)
show and hide independently? If the former, I have no clue. If the latter, I
think we'll need some more details and/or some code - I can't reproduce it
at all in a quick test.
--
Enjoy,
Tony

> I have a userform that is modeless so I can swith to and from the form and
> the activedocument.  In this userform there is a sub-form (a form that is
[quoted text clipped - 18 lines]
> http://gregmaxey.mvps.org/word_tips.htm
> For some helpful tips using Word.
Greg Maxey - 15 Oct 2005 14:02 GMT
Tony,

I can't duplicate it this morning either either.  I think I might have had a
mild glitch and things got sorted out after saving and closing Word last
night.

What I meant by sub-form is a second user form that is called from a form in
use.  So it is a second userform that I want to show "if" a certain
condition is created in the first form to handle that condition, close, and
redisplay the original form.  Again things appear to be working now.
Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> I'm not entirely sure what you mean by a sub-form (VBA Userforms are not
> like Access Forms). Do you somehow have the subform embedded as a control
[quoted text clipped - 33 lines]
>> http://gregmaxey.mvps.org/word_tips.htm
>> For some helpful tips using Word.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.