Results 1 to 7 of 7

Different behavior if I close userform via button or x

Threaded View

  1. #1
    Registered User
    Join Date
    05-27-2011
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    72

    Different behavior if I close userform via button or x

    This is the code I use to hide a userform whether it is done by hitting the "Close" button or the "X" at the top right. For some reason when I use the close button then re-open the form it will still show all the typed data that was on the form before closing if I had not submitted it. This does not happen when I hit the X however, when I re-open the form it is once again blank. Anyone know why or where the fault is in my code?

    Private Sub cmdClose2_Click()
        AddInfo.Hide    
    End Sub
    
    Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
        If CloseMode <> 1 Then
            AddInfo.Hide
        End If
    End Sub
    Last edited by nohero; 07-05-2011 at 04:05 PM.

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