Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Aug 2001
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    UserForm QueryClose (2000)

    Hey all, I'm trying to control what happens when the user closes a userform by clicking the "X" in the upper right. However the way I did it, it only performs this action once. After that, clicking X has no result.

    Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    MsgBox "Bye"
    Cancel = 1
    Rank.Hide
    Main.Show
    End Sub

  2. #2
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: UserForm QueryClose (2000)

    I think it has something to do with your other form, maybe the initialize event or such. When I use the following, it works for me:

    <pre>Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    MsgBox "Bye"
    Cancel = 1
    UserForm1.Hide
    End Sub
    </pre>


Posting Permissions

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