Front End Tools
Front End Tools
Form Design:
Coding: Private Sub Combo1_Change() Combo1.AddItem "BTech" Combo1.AddItem "MTech" Combo1.AddItem "BE" Combo1.AddItem "ME" End Sub
Private Sub Command1_Click() List1.AddItem Text1.Text List1.AddItem Text2.Text If Option1.Value = True Then gender = "male" End If If Option2.Value = True Then gender = "female" End If List1.AddItem gender List1.AddItem Text3.Text If Check1.Value = 1 And Check2.Value = 0 Then area = "software Engineering & Networks" End If If Check1.Value = 0 And Check2.Value = 1 Then area = " Networks" End If List1.AddItem area List1.AddItem Text4.Text End Sub
Private Sub Option1_Click() If (Option1.Value = True) Then MsgBox ("You have selected Male") ElseIf (Option2.Value = True) Then MsgBox ("You have selected Female") End If End Sub
Private Sub Option2_Click() If (Option1.Value = True) Then MsgBox ("You have selected Male") ElseIf (Option2.Value = True) Then MsgBox ("You have selected Female") End If End Sub
Output:
Login Form:
Details Form:
Mark Form:
Personal Form:
Main Form Coding: Private Sub Command1_Click() LoginForm.Show End Sub Private Sub Command2_Click() End End Sub Login Form Coding: Private Sub Command1_Click() If Text1.Text = "Admin" And Text2.Text = "***" Then DetailsForm.Show Else MsgBox "Invalid UserName and Password" End If
Unload Me End Sub Private Sub Command2_Click() Unload Me End Sub Details Form Coding: Private Sub Command1_Click() MarkForm.Show End Sub Private Sub Command2_Click() PersonalForm.Show End Sub Private Sub Command3_Click() MainForm.Show End Sub Mark Form Coding: Private Sub Command1_Click() Adodc1.Recordset.AddNew End Sub Private Sub Command2_Click() Adodc1.Recordset.Delete End Sub Private Sub Command3_Click() DetailsForm.Show End Sub
Personal Form Coding: Private Sub Command1_Click() Adodc1.Recordset.AddNew End Sub Private Sub Command2_Click() Adodc1.Recordset.Delete End Sub Private Sub Command3_Click() DetailsForm.Show End Sub Output:
MENU DESIGN
Theory:
Adding Menu Bar Using Menu Editor To start adding menu items to your application, open an existing project or start a new project, then click on Tools in the menu bar of the Visual Basic IDE and select Menu Editor. When you click on the Menu Editor, the Menu Editor dialog will appear. In the Menu Editor dialog , key in the first item File in thecaption text box. You can use the ampersand ( & ) sign in front of F so that F will be underlined when it appears in the menu, and F will become the hot key to initiate the action under this item by pressing the Alt key and the letter F. After typing &File in the Caption text box, move to the name textbox to enter the namefor this menu item, you can type in mnuFile here. Now, click the Next button and the menu item &File will move into the empty space below, as shown in the following diagram:
You can then add in other menu items on the menu bar by following the same procedure, as shown in the diagram below:
when you click Ok, the menu items will be shown on the menu bar of the form.
Now, you may proceed to add the sub menus. In the Menu Editor, click on the Insert button between Fileand Exit and then click the right arrow key, and the dotted line will appear. This shows the second level ofthe menu, or the submenu. Now key in the caption and the name. Repeat the same procedure to add other submenu items. Here, we are adding New, Open, Save, Save As and Exit.
Now click the OK button and go back to your form. You can see the dropped down submenus when you click on the item File, as shown.
Coding: Private Sub Command1_Click() DataReport1.Show End Sub Private Sub Command2_Click() DataReport2.Show End Sub Private Sub Command3_Click() End End Sub
Output: