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 / February 2008

Tip: Looking for answers? Try searching our database.

how to close a userform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Southern at Heart - 03 Feb 2008 00:21 GMT
How do you add code to your commandbutton, so that after it has performed
it's request, it closes the Userform?
I tried the unload command, like in Access, but I maybe don't have the
syntax right...
thanks
Southern@Heart
Shauna Kelly - 03 Feb 2008 05:55 GMT
Hi

Within a form,
   Me.Hide
will hide the form. You need to unload it later.

Within a form,
   Unload Me
will unload the form from memory.

Or, in a standard module or a class module, you can create a variable to
hold an instance of the form, eg:

Dim frm as MyUserForm

   set frm = new MyUserForm
   frm.Show
   'let the form do its stuff.
   'have the OK button do Me.Hide

   'back in the main module
   Unload frm

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> How do you add code to your commandbutton, so that after it has
> performed
[quoted text clipped - 3 lines]
> thanks
> Southern@Heart
 
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.