Loading one userform from another

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bhasky12345
    New Member
    • Jan 2013
    • 3

    Loading one userform from another

    Hi all,
    I am new to VB. I have to create one Windows Form application where user inputs the data and after the final submission, the entered data is displayed in the form of a word file. So far I have created 4 user forms each representing one step (out of total 4 steps).
    When I load the 2nd form from the first, first form is still displayed at the background which I do not want. How do I make it word? I have used
    Code:
    Private Sub Next_Button_Click(sender As Object, e As EventArgs) Handles Next_Button.Click
            Step2.Show()
        End Sub
    Also, do I have to collect the data in a database first before creating the word file?

    Please help me. Thanks in adv.

    BR, Bhaskar
    Last edited by Rabbit; Jan 15 '13, 05:03 PM. Reason: Please use code tags when posting code.
  • IronRazer
    New Member
    • Jan 2013
    • 83

    #2
    If you are just trying to hide the first form when showing the second one you can try this.

    I am guessing your first form must be called (Step1)
    You can use Step1.Hide() such as :

    Code:
        Private Sub Next_Button_Click(sender As Object, e As EventArgs) Handles Next_Button.Click
            Step1.Hide()  
            Step2.Show()
        End Sub
    Last edited by Rabbit; Jan 15 '13, 08:23 PM. Reason: Please use code tags when posting code.

    Comment

    • bhasky12345
      New Member
      • Jan 2013
      • 3

      #3
      Thanks. That worked. Now I have a different requirement. I need to load an instance of Step1 (with the filled entries) from Step 2 (second form). I do not want to load the Step1 form afresh, instead I want to load the instance of the first form where the user would have filled in some entries and navigated to Step2. How do I do that? I can create the instance as
      Code:
      Dim f1 As Step1
      But I cannot use
      Code:
      f1.Show()
      in the second form.
      Hope my situation as well as requirement is clear to you.
      Please help.

      Thanks, Bhaskar

      Comment

      • PsychoCoder
        Recognized Expert Contributor
        • Jul 2010
        • 465

        #4
        We like to limit to a single question in a thread, makes it easier to see what's going on. So if you could open a new thread with your new requirements it would be greatly appreciated :)

        Comment

        Working...