Results 1 to 4 of 4

Thread: Userform (XP)

  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Userform (XP)

    Is it possible to have a modal userform unload and then display a message box?

    The challenge I am having is with the follow code: The userform does no unload until after I click on the message box.

    Sub Example_Code() 'Status is the name of a userform
    Load Status
    Status.Show (modal)
    Run some code
    Unload Status
    Msgbox "Finished"
    End sub


    Thanks,
    John

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Userform (XP)

    Is modal a global constant or variable? If not, try removing (modal)

    I don't understand why you have Unload Status. If you show a form as modal, it won't close until the user explicitly closes it and then Unload isn't necessary.

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform (XP)

    Hans,

    In the line "run some code" I am updating labels associated with the userform and repainting it to display text in the labels.

    If I remove 'modal' from the code then the userform will on update until the user clicks on it. Perhaps a better way to display a 'finished' notification would be to change the appearance of the userform and have the user cancel out of the form. I thought I could work around this just by using a message box.

    Regards,
    John

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Userform (XP)

    If you want to update labels etc., do so in the UserForm_Initialize event.

Posting Permissions

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