-
I have just started VB programming.
I have a form at the start and some text boxes on it.
I have a command button at the bottom and when I press the command button i want it to load another particular form.
it is like making a command button linked to msgbox but i dont want msgbox. I want another sub form.
Thanks all!!
-
Is this what you are asking for?
Code:
--------------------------
'Make a CommandButton called cmdButton on the first form and copy this code onto the form.
'Make another form at design time, with the name frmAnother.frm
'Run the project and click cmdButton and the other form shows.
Private Sub cmdButton_Click()
Load frmAnother
frmAnother.Show
End Sub
-
That is right, but you do not need "Load Form2".
Show is enough.
Code:
Private Sub Command1_Click()
Form2.Show
End Sub
-
Thank you for the help
I didn't expect help to arrive so shortly
thank you!!
-
How do i make it that when i load the second form the first form will disappear??
-
to hide the first window:
-
Code:
Private Sub Command1_Click()
Load Form2
Form2.Show
Form1.Hide
Unload Form1
End Sub
-
You can also use
This way, the 2nd form is modal. So, you can't switch back to the 1st form, until FrmTwo.Hide.
(Like a normal Messagebox)
-