Lets say I want to go from Form1 to Form2 via Next button
I try to
Private Sub cmdNext_Click()
Unload Form1
Load Form2
End Sub
But only form1 unloads and nothing else happens
Please help a newbie
Printable View
Lets say I want to go from Form1 to Form2 via Next button
I try to
Private Sub cmdNext_Click()
Unload Form1
Load Form2
End Sub
But only form1 unloads and nothing else happens
Please help a newbie
Use this. Form2.Show
When you Load a Form, the Load Subroutine is invoked. In that subroutine, you should request that Form be shown (Use "Form1.Show" if "Form1" is name of your Form).
I think you can show the form without loading it (VB will load it automatically), but this is not a good idea. There are usually some things you want to do when form is loaded, so you will want to write Code in the Load Subroutine. Start with just "Form1.Show" as the only code, and go on from there.
VB sets TabIndex Values in the order you put Controls on the Form. You can override these values at Design Time, but it tends to be more convenient to do it at Run Time in the Load Subroutine. There are various other initializations conveniently taken care of in the Load Subroutine.
Good luck with VB
You also can do it in this way too
Code:Private Sub cmdNext_Click()
Form1.Hide
Form2.ShoW
End Sub
Private Sub cmdNext_Click()
Form1.Show
Form2.Hide
End Sub