Multiple Userform

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • williamyeow
    New Member
    • Sep 2006
    • 1

    Multiple Userform

    Hi i am new to excel VB. can anyone tell me how to link userform to another userform?

    My concept for my program
    I have set up a userform with a couple of option. after the user has chose the options and click next, userform2 will be activated.

    Thanks
  • milkyman
    New Member
    • Aug 2006
    • 12

    #2
    Ok, that's very easy.

    If you make a CommandButton on your form and place this code inside it. it wil work.

    Private Sub CommandButton1_ Click()

    UserForm2.Show

    End Sub

    de command "UserForm2.Show " calls your 2th form.
    (i assume that your 2th form is called UserForm2, if not you have to put here the name of your form)

    have funn with it......

    Comment

    • NSF12345
      New Member
      • Aug 2006
      • 21

      #3
      When you have finished with that form, and have a close button, just put "userform2.hide " this hides the 2nd userform. Some people prefer to hide the 1st form when the 2nd form is opend, so they have something like this:

      'Code on Form1
      private sub Command1.click ()
      form1.hide
      form2.show
      end sub

      then when they have finished with the 2nd form they swap the code around to this:

      'Code on form2
      private sub Command1.click ()
      form1.show
      form2.hide
      end sub

      hope tht helps

      Comment

      Working...