+ Reply to Thread
Results 1 to 4 of 4

unload userform problem

Hybrid View

  1. #1
    Registered User
    Join Date
    06-13-2006
    Posts
    76

    unload userform problem

    Hi,

    I have some userforms and some code to get those userforms to work.
    In a few userforms I end the code like:

    ...
    Unload UserForm2
    UserForm3.show
    And when I push the CommandButton2 (=Cancel) on this UserForm3, UserForm2 is back again.

    The only problem is that the "Unload Me" command doesn't work so well. UserForm3 comes in front of UserForm2, but UserForm2 doesn't disappear?
    Also when I drag Userform2 through the screen, before I push any button to activate the code, the userform is spread out all through the screen. When I try this with a userform that is not connected to another userform, this speading out doesn't happen.
    Does someone know what the problem is? Thanks in advance!
    Last edited by leonidas; 07-05-2006 at 08:44 AM.

  2. #2
    Jim Rech
    Guest

    Re: unload userform problem

    "Me" doesn't unload until the code in "Me" is done running. I'd suggest the
    you put UserForm3.show in a sub in a standard module and that you call that
    sub with an OnTime macro:

    Unload Me
    Application.OnTime Now, "SubToShowUF3"


    --
    Jim
    "leonidas" <[email protected]> wrote in
    message news:[email protected]...
    |
    | Hi,
    |
    | I have some userforms and some code to get those userforms to work.
    | In a few userforms I end the code like:
    |
    |
    | Code:
    | --------------------
    | ...
    | Unload Me
    | UserForm3.show
    | --------------------
    |
    |
    | And when I push the CommandButton2 (=Cancel) on this UserForm3 the
    | previous userform is back again.
    |
    | The only problem is that the "Unload Me" command doesn't work so well.
    | UserForm3 comes in front of the previous userform, but the previous
    | userform isn't really disappearing?
    | Does someone know what the problem is? Thanks in advance!
    |
    |
    | --
    | leonidas
    | ------------------------------------------------------------------------
    | leonidas's Profile:
    http://www.excelforum.com/member.php...o&userid=35375
    | View this thread: http://www.excelforum.com/showthread...hreadid=558400
    |



  3. #3
    Registered User
    Join Date
    06-13-2006
    Posts
    76

    userform drag problem

    Hi Jim,

    That solution worked for me! Thanks!
    But I still have a problem with dragging those userforms (see attachment).
    Do you (or someone else) know how to solve that problem?
    Thanks in advance!
    Attached Images Attached Images

  4. #4
    Registered User
    Join Date
    06-13-2006
    Posts
    76

    Red face Problem solved!

    Hi,

    I have solved the problem with dragging userforms over the screen.
    I used "Application.ScreenUpdating = False" and then the userform doesn't update too. By ending the macro with "Application.ScreenUpdating = True" the problem was solved!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1