Step 4: Linking the ViewEmployees form
To link the ViewEmployees form, follow these steps:
- Right click on the ViewEmployees project form and select the View Code pop-up menu entry. This should open the form's code view.
- Insert the following subroutine:
Public Sub ShowMe()
Me.Show()
End Sub
- Right click on the Main project form and select View Designer pop-up menu entry. This should open the form's designer view.
- From the Toolbox, drag a button control and drop it on the Main form.
- Select the new button.
- In the Properties dialog, specify the value btnViewEmployees for the Name property.
- In the Properties dialog, specify the value View Employees for the Text property.
- Double click on the btnViewEmployees button. This should open the code view.
- In the btnViewEmployees_Click subroutine, type the following code:
frmViewEmployees.ShowMe()
- Save the project.