Login Form
description
Transcript of Login Form
LOGIN FORM
This form shows login form. It always asks for username and password.
MAIN FORM
It shows the main form. It contains different buttons, menus and sub menu items
New Employee Form
Form for adding new employee. It contains information of the employee including name, date of birth, rate and numbers of hours per day.
Payroll process
This form automatically generates the salary of the employee for the given period of time.
DTR
Shows the attendance / daily time record of the employee.
Backup and restore FORM
Use for backing up database
Use for restoring Backed up database.
SOURCE CODEPrivate Sub Form_Load()loadallEnd Sub
Private Sub Form_Unload(Cancel As Integer)'Unload frmaddempUnload MeMe.Visible = Falsefrm_Main.ShowEnd Sub
Private Sub Label1_Click()'frmaddemp.Visible = False'Unload frmaddempUnload MeMe.Visible = Falsefrm_Main.ShowEnd SubPublic Sub loadall()Dim iTm As ListItemcOnDim RS As ADODB.RecordsetSet RS = New ADODB.RecordsetRS.Open "select * from employee", Cn, adOpenDynamic, adLockOptimisticIf RS.RecordCount 0 Then lv1.ListItems.Clear Do While Not RS.EOF
Set iTm = lv1.ListItems.Add(, , RS!ID) iTm.ListSubItems.Add , , RS!Name iTm.ListSubItems.Add , , RS!Type iTm.ListSubItems.Add , , RS!gender iTm.ListSubItems.Add , , RS!Position RS.MoveNext Loop End If
End Sub
Private Sub Label2_Click()Unload Mefrmaddemp.ShowEnd Sub
Private Sub Label3_Click()If Me.lv1.SelectedItem.Text = "" ThenMsgBox "No record Selected!!!'"ElseMe.Enabled = Falseeditemp.empid = Me.lv1.SelectedItem.TextSet RS = NothingcOnRS.Open "Select * from employee where id = '" & Me.lv1.SelectedItem & "'", Cn, adOpenDynamic, adLockOptimisticIf RS.RecordCount 0 Theneditemp.txtFName = RS!Nameeditemp.cbtype = RS!TypeEnd IfMe.Hidefrmeditemp.ShowEnd IfEnd Sub
Private Sub Label4_Click()If Me.lblid = "" ThenMsgBox " No Selected record!!!"Else
Dim a As Stringa = MsgBox("Are you sure you want to save this data?", vbYesNo)If a = vbYes Then Set RS = Nothing cOn RS.Open "Select * from employee where id = '" & Me.lblid & "'", Cn, adOpenDynamic, adLockOptimistic If RS.RecordCount 0 Then RS.Delete End If MsgBox " Record Deleted!!!" allemp.loadallEnd IfEnd IfEnd Sub
Private Sub lv1_Click()Me.lblid = Me.lv1.SelectedItem.TextEnd Sub
Private Sub lv1_DblClick()If Me.lv1.SelectedItem.Text = "" ThenMsgBox "No record Selected!!!'"ElseMe.Enabled = Falsefrmeditemp.empid = Me.lv1.SelectedItem.TextSet RS = NothingcOnRS.Open "Select * from employee where id = '" & Me.lv1.SelectedItem & "'", Cn, adOpenDynamic, adLockOptimisticIf RS.RecordCount 0 Thenfrmeditemp.txtFName = RS!Namefrmeditemp.cbtype = RS!TypeEnd IfUnload Mefrmeditemp.ShowEnd IfEnd Sub
Sub search1()Dim iTm As ListItemcOnDim RS As ADODB.RecordsetSet RS = New ADODB.RecordsetRS.Open "select * from employee where id like '%" & Me.txtsearch & "%'", Cn, adOpenDynamic, adLockOptimisticIf RS.RecordCount 0 Then lv1.ListItems.Clear Do While Not RS.EOF
Set iTm = lv1.ListItems.Add(, , RS!ID) iTm.ListSubItems.Add , , RS!Name iTm.ListSubItems.Add , , RS!Type RS.MoveNext Loop End IfEnd Sub
Sub search2()Dim iTm As ListItemcOnDim RS As ADODB.RecordsetSet RS = New ADODB.RecordsetRS.Open "select * from employee where name like '%" & Me.txtsearch & "%'", Cn, adOpenDynamic, adLockOptimisticIf RS.RecordCount 0 Then lv1.ListItems.Clear Do While Not RS.EOF
Set iTm = lv1.ListItems.Add(, , RS!ID) iTm.ListSubItems.Add , , RS!Name iTm.ListSubItems.Add , , RS!Type RS.MoveNext Loop End IfEnd Sub