Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2007
    Posts
    127

    Unanswered: Selecting previous UserForm

    I've just added a command button to my UserForm, I want it to display the previous UserForm,


    and if possible to close the current form, or will that mess up the data already entered onto the form?



    Private Sub CommandButton4_Click()

    End Sub

  2. #2
    Join Date
    Feb 2004
    Posts
    533
    If the Sub is in the Code Module of the Userform you can refer to the form as object "Me" this will resolve to the parent form.

    Private Sub CommandButton4_Click()
    Me.Hide
    End Sub

    If the Sub is not in the Code Module of the Form you will refer to the Form Object using the Form Name.

    Private Sub CommandButton4_Click()
    UserForm1.Hide
    End Sub

    Refer to the MS Excel VB Help for the: "Hide Method", Hides an object but doesn't unload it.
    ~

    Bill

  3. #3
    Join Date
    Oct 2007
    Posts
    127
    thanks mate

Posting Permissions

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