By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,344 Members | 1,114 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,344 IT Pros & Developers. It's quick & easy.

Loading one userform from another

P: 3
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
Expand|Select|Wrap|Line Numbers
  1. Private Sub Next_Button_Click(sender As Object, e As EventArgs) Handles Next_Button.Click
  2.         Step2.Show()
  3.     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
Jan 15 '13 #1
Share this Question
Share on Google+
3 Replies

P: 83
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 :

Expand|Select|Wrap|Line Numbers
  1.     Private Sub Next_Button_Click(sender As Object, e As EventArgs) Handles Next_Button.Click
  2.         Step1.Hide()  
  3.         Step2.Show()
  4.     End Sub
Jan 15 '13 #2

P: 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
Expand|Select|Wrap|Line Numbers
  1. Dim f1 As Step1
But I cannot use
Expand|Select|Wrap|Line Numbers
  1. f1.Show()
in the second form.
Hope my situation as well as requirement is clear to you.
Please help.

Thanks, Bhaskar
Jan 29 '13 #3

Expert Mod 100+
P: 465
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 :)
Jan 29 '13 #4

Post your reply

Sign in to post your reply or Sign up for a free account.