954,148 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How would I get a form to appear in VB?

I know this seems like a very noobish question and has probably been asked many times before, I'm trying to write a lottery program in which the numbers are generated, then you can check your numbers. There is a command button on the first form which says "Check Numbers" and this would take you onto the second form. Can anyone help me by telling me how to bring this up by clicking the command button? Thanks.

shotgunjoe
Newbie Poster
2 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

type this code in your command button click event:

Form2.Show

ryan_vietnow
Posting Pro
578 posts since Aug 2007
Reputation Points: 28
Solved Threads: 71
 
Private Sub Command1_Click()
    Form2.Show
End Sub


If you press theCommand1 button it will automatically show the another form..

werks
Junior Poster in Training
57 posts since Jan 2008
Reputation Points: 10
Solved Threads: 1
 

Great guys, thanks a lot! I appreciate it!

shotgunjoe
Newbie Poster
2 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

To do what you want do the following
Private Sub Command1_Click()
Form2.Show
End Sub
NB: if you have given your second form a name write that name instead of form2
Hope i've helped.

K-Dave
Newbie Poster
18 posts since Jan 2008
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You