Sie sind auf Seite 1von 41

Coding: 1 Form

Private Sub Command1_Click()

If Text1.Text = "Admin" And Text2.Text = "admin" Then Form7.Show Me.Hide Else If Text1.Text = "Employee" And Text2.Text = "emp" Then Form8.Show

End If End If

End Sub

Private Sub Command2_Click() Me.Hide End Sub

Private Sub Form_Load()

End Sub

Dim con As New ADODB.Connection Dim rs As New ADODB.Recordset

Private Sub Command1_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" Text8.Text = "" Text9.Text = "" Text10.Text = "" Text11.Text = "" Text12.Text = "" Text13.Text = "" End Sub

Private Sub Command2_Click()

rs.AddNew rs(0) = Text1.Text rs(1) = Text2.Text rs(2) = Text3.Text rs(3) = Text4.Text rs(4) = Text5.Text rs(5) = Text6.Text rs(6) = Text7.Text rs(7) = Text8.Text rs(8) = Text9.Text rs(9) = Text10.Text rs(10) = Text11.Text rs(11) = Text12.Text rs(12) = Text13.Text rs.Update

MsgBox " Saved Successfully"

End Sub

Private Sub Command3_Click()

Me.Hide

End Sub

Private Sub Command4_Click() mb = MsgBox("Are u sure want to delete this details", vbYesNo, "Employee Details") If mb = vbNo Then Exit Sub End If

rs.MoveFirst rs.Find "[empid]=" & Val(Text1) If rs.EOF = False Then

Text1.Text = rs(0) Text2.Text = rs(1) Text3.Text = rs(2) Text4.Text = rs(3) Text5.Text = rs(4) Text6.Text = rs(5) Text7.Text = rs(6) Text8.Text = rs(7) Text9.Text = rs(8) Text10.Text = rs(9)

Text11.Text = rs(10) Text12.Text = rs(11) Text13.Text = rs(12) End If

rs.Delete rs.MoveNext Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" Text8.Text = "" Text9.Text = "" Text10.Text = "" Text11.Text = "" Text12.Text = "" Text13.Text = "" MsgBox "Record Deleted", , "Employee Details"

End Sub

Private Sub Command5_Click()

rs.MoveFirst rs.Find "[empid]=" & Val(Text1)

If rs.EOF = False Then

Text1.Text = rs(0) Text2.Text = rs(1) Text3.Text = rs(2) Text4.Text = rs(3) Text5.Text = rs(4) Text6.Text = rs(5) Text7.Text = rs(6) Text8.Text = rs(7) Text9.Text = rs(8) Text10.Text = rs(9) Text11.Text = rs(10) Text12.Text = rs(11)

Text13.Text = rs(12) Else MsgBox "record not found"

End If End Sub

2 coding Private Sub Command6_Click() Form7.Show Me.Hide End Sub

Private Sub Command7_Click() DataReport1.Show

End Sub

Private Sub Command8_Click()

rs(0) = Text1.Text rs(1) = Text2.Text rs(2) = Text3.Text rs(3) = Text4.Text rs(4) = Text5.Text

rs(5) = Text6.Text rs(6) = Text7.Text rs(7) = Text8.Text rs(8) = Text9.Text rs(9) = Text10.Text rs(10) = Text11.Text rs(11) = Text12.Text rs(12) = Text13.Text rs.Update

MsgBox " Updated Successfully" End Sub

Private Sub Form_Load() con.CursorLocation = adUseClient con.Open "Provider=MSDASQL.1;Data Source=oracle1;Persist Security Info=False" rs.Open "select * from emp1", con, adOpenDynamic, adLockOptimistic

End Sub

3 coding: Dim con As New ADODB.Connection Dim rs As New ADODB.Recordset

Private Sub Command1_Click()

rs.AddNew rs.Fields(0) = Text1.Text rs.Fields(1) = Text2.Text rs.Fields(2) = Text3.Text rs.Fields(3) = Text4.Text rs.Fields(4) = Text5.Text rs.Fields(5) = Text6.Text rs.Fields(6) = Text7.Text rs.Fields(7) = Text8.Text rs.Fields(8) = Text9.Text rs.Fields(9) = Text10.Text rs.Fields(10) = Text11.Text rs.Fields(11) = Text12.Text rs.Fields(12) = Text13.Text rs.Fields(13) = Text14.Text rs.Update

MsgBox " Saved Successfully"

End Sub

Private Sub Command2_Click() Text1.Text = ""

Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" Text8.Text = "" Text9.Text = "" Text10.Text = "" Text11.Text = "" Text12.Text = "" Text13.Text = "" Text14.Text = "" End Sub

Private Sub Command3_Click() mb = MsgBox("Are u sure want to delete this details", vbYesNo, "Payroll Process") If mb = vbNo Then Exit Sub End If

rs.MoveFirst rs.Find "[empid]=" & Val(Text1) If rs.EOF = False Then

Text1.Text = rs(0) Text2.Text = rs(1) Text3.Text = rs(2) Text4.Text = rs(3) Text5.Text = rs(4) Text6.Text = rs(5) Text7.Text = rs(6) Text8.Text = rs(7) Text9.Text = rs(8) Text10.Text = rs(9) Text11.Text = rs(10) Text12.Text = rs(11) Text13.Text = rs(12) Text14.Text = rs(13) End If rs.Delete rs.MoveNext

Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = ""

Text6.Text = "" Text7.Text = "" Text8.Text = "" Text9.Text = "" Text10.Text = "" Text11.Text = "" Text12.Text = "" Text13.Text = "" Text14.Text = "" MsgBox "Record Deleted", , "Payroll Process"

End Sub

Private Sub Command4_Click() rs.MoveFirst rs.Find "[empid]=" & Val(Text1)

If rs.EOF = False Then Text1.Text = rs(0) Text2.Text = rs(1) Text3.Text = rs(2) Text4.Text = rs(3) Text5.Text = rs(4) Text6.Text = rs(5) Text7.Text = rs(6)

Text8.Text = rs(7) Text9.Text = rs(8) Text10.Text = rs(9) Text11.Text = rs(10) Text12.Text = rs(11) Text13.Text = rs(12) Text14.Text = rs(13)

Else MsgBox "record not found"

End If

End Sub

Private Sub Command5_Click() Form7.Show Me.Hide End Sub

Private Sub Command6_Click() Me.Hide

End Sub

Private Sub Command7_Click() rs(0) = Text1.Text rs(1) = Text2.Text rs(2) = Text3.Text rs(3) = Text4.Text rs(4) = Text5.Text rs(5) = Text6.Text rs(6) = Text7.Text rs(7) = Text8.Text rs(8) = Text9.Text rs(9) = Text10.Text rs(10) = Text11.Text rs(11) = Text12.Text rs(12) = Text13.Text rs(13) = Text14.Text rs.Update MsgBox "Update successfully"

End Sub

Private Sub Form_Load() con.CursorLocation = adUseClient con.Open "Provider=MSDASQL.1;Data Source=oracle1;Persist Security Info=False"

rs.Open "select * from pay", con, adOpenDynamic, adLockOptimistic

End Sub

Private Sub Text11_GotFocus() Text11.Text = Val(Text8) + Val(Text9) + Val(Text10)

End Sub

Private Sub Text14_GotFocus() Text14.Text = Val(Text11) - Val(Text12) - Val(Text13)

End Sub 4 coding Private Sub Command1_Click() Form2.Show Me.Hide

End Sub

Private Sub Command2_Click() Form3.Show Me.Hide

End Sub

Private Sub Command3_Click() Form9.Show Me.Hide

End Sub

Private Sub Command4_Click() Form6.Show Me.Hide

End Sub

Private Sub Command5_Click() Form5.Show Me.Hide

End Sub

Private Sub Command6_Click()

Me.Hide

End Sub 5 coding Private Sub Command1_Click() Form2.Show Me.Hide

End Sub

Private Sub Command2_Click() Form3.Show Me.Hide

End Sub

Private Sub Command3_Click() Form9.Show Me.Hide

End Sub

Private Sub Command4_Click() Form6.Show Me.Hide

End Sub

Private Sub Command5_Click() Form5.Show Me.Hide

End Sub

Private Sub Command6_Click() Me.Hide

End Sub 6 coding Private Sub Command1_Click() Form2.Show Me.Hide

End Sub

Private Sub Command2_Click() Form3.Show Me.Hide

End Sub

Private Sub Command3_Click() Form9.Show Me.Hide

End Sub

Private Sub Command4_Click() Form6.Show Me.Hide

End Sub

Private Sub Command5_Click() Form5.Show Me.Hide

End Sub

Private Sub Command6_Click() Me.Hide

End Sub 7 coding Private Sub Command1_Click()

Dim q As String

q = "select * from employeedet where empid=" & Val(Text1) Adodc2.Refresh Adodc2.RecordSource = q

Text1.Text = Adodc2.Recordset.Fields(0) Text2.Text = Adodc2.Recordset.Fields(1) Text3.Text = Adodc2.Recordset.Fields(2) Text4.Text = Adodc2.Recordset.Fields(3) Text5.Text = Adodc2.Recordset.Fields(4) Text6.Text = Adodc2.Recordset.Fields(5) Text7.Text = Adodc2.Recordset.Fields(6) Text8.Text = Adodc2.Recordset.Fields(7) Text9.Text = Adodc2.Recordset.Fields(8) Text10.Text = Adodc2.Recordset.Fields(9) Text11.Text = Adodc2.Recordset.Fields(10) Text12.Text = Adodc2.Recordset.Fields(11) Text13.Text = Adodc2.Recordset.Fields(12) End Sub

Private Sub Form_Load()

End Sub

8 coding: Dim con As New ADODB.Connection Dim rs As New ADODB.Recordset

Private Sub Adodc6_WillMove(ByVal adReason As ADODB.EventReasonEnum, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)

End Sub

Private Sub Command1_Click() rs.AddNew rs(0) = Text1.Text rs(1) = Text2.Text rs(2) = Text3.Text rs(3) = Text4.Text rs(4) = Text5.Text rs(5) = Text6.Text rs(6) = Text7.Text rs(7) = Text8.Text rs(8) = Text9.Text rs(9) = Text10.Text rs(10) = Text11.Text rs(11) = Text12.Text rs(12) = Text13.Text rs(13) = Text14.Text

rs(14) = Text16.Text rs(15) = Text18.Text rs(16) = Text20.Text rs(17) = Text22.Text rs(18) = Text24.Text rs(19) = Text26.Text rs(20) = Text31.Text rs(21) = Text27.Text rs(22) = Text28.Text rs(23) = Text29.Text rs(24) = Text30.Text rs(25) = Text32.Text rs(26) = Text33.Text rs(27) = Text34.Text rs(28) = Text35.Text

rs.Update

MsgBox " Saved Successfully"

End Sub

Private Sub Command2_Click() mb = MsgBox("Are u sure want to delete this details", vbYesNo, "FullTime") If mb = vbNo Then

Exit Sub End If

rs.MoveFirst rs.Find "[empid]=" & Val(Text1) If rs.EOF = False Then

Text1.Text = rs(0) Text2.Text = rs(1) Text3.Text = rs(2) Text4.Text = rs(3) Text5.Text = rs(4) Text6.Text = rs(5) Text7.Text = rs(6) Text8.Text = rs(7) Text9.Text = rs(8) Text10.Text = rs(9) Text11.Text = rs(10) Text12.Text = rs(11) Text13.Text = rs(12) Text14.Text = rs(13) Text16.Text = rs(14) Text18.Text = rs(15) Text20.Text = rs(16) Text22.Text = rs(17)

Text24.Text = rs(18) Text26.Text = rs(19) Text31.Text = rs(20) Text27.Text = rs(21) Text28.Text = rs(22) Text29.Text = rs(23) Text30.Text = rs(24) Text32.Text = rs(25) Text33.Text = rs(26) Text34.Text = rs(27) Text35.Text = rs(28) End If rs.Delete rs.MoveNext

Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" Text8.Text = ""

Text9.Text = "" Text10.Text = "" Text11.Text = "" Text12.Text = "" Text13.Text = "" Text14.Text = "" Text16.Text = "" Text18.Text = "" Text20.Text = "" Text22.Text = "" Text24.Text = "" Text26.Text = "" Text31.Text = "" Text27.Text = "" Text28.Text = "" Text29.Text = "" Text30.Text = "" Text32.Text = "" Text33.Text = "" Text34.Text = "" Text35.Text = "" MsgBox "Record Deleted"

End Sub

Private Sub Command3_Click() rs(0) = Text1.Text rs(1) = Text2.Text rs(2) = Text3.Text rs(3) = Text4.Text rs(4) = Text5.Text rs(5) = Text6.Text rs(6) = Text7.Text rs(7) = Text8.Text rs(8) = Text9.Text rs(9) = Text10.Text rs(10) = Text11.Text rs(11) = Text12.Text rs(12) = Text13.Text rs(13) = Text14.Text rs(14) = Text16.Text rs(15) = Text18.Text rs(16) = Text20.Text rs(17) = Text22.Text rs(18) = Text24.Text rs(19) = Text26.Text rs(20) = Text31.Text

rs(21) = Text27.Text rs(22) = Text28.Text rs(23) = Text29.Text rs(24) = Text30.Text rs(25) = Text32.Text rs(26) = Text33.Text rs(27) = Text34.Text rs(28) = Text35.Text rs.Update MsgBox "Update successfully"

End Sub

Private Sub Command4_Click() rs.MoveFirst rs.Find "[empid]=" & Val(Text1)

If rs.EOF = False Then Text1.Text = rs(0) Text2.Text = rs(1) Text3.Text = rs(2) Text4.Text = rs(3) Text5.Text = rs(4) Text6.Text = rs(5)

Text7.Text = rs(6) Text8.Text = rs(7) Text9.Text = rs(8) Text10.Text = rs(9) Text11.Text = rs(10) Text12.Text = rs(11) Text13.Text = rs(12) Text14.Text = rs(13) Text16.Text = rs(14) Text18.Text = rs(15) Text20.Text = rs(16) Text22.Text = rs(17) Text24.Text = rs(18) Text26.Text = rs(19) Text31.Text = rs(20) Text27.Text = rs(21) Text28.Text = rs(22) Text29.Text = rs(23) Text30.Text = rs(24) Text32.Text = rs(25) Text33.Text = rs(26) Text34.Text = rs(27) Text35.Text = rs(28)

Else

MsgBox "record not found"

End If

End Sub

Private Sub Command5_Click() Me.Hide

End Sub

Private Sub Command6_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" Text8.Text = "" Text9.Text = "" Text10.Text = "" Text11.Text = "" Text12.Text = ""

Text13.Text = "" Text14.Text = "" Text16.Text = "" Text18.Text = "" Text20.Text = "" Text22.Text = "" Text24.Text = "" Text26.Text = "" Text31.Text = "" Text27.Text = "" Text28.Text = "" Text29.Text = "" Text30.Text = "" Text32.Text = "" Text33.Text = "" Text34.Text = "" Text35.Text = ""

End Sub

Private Sub Command7_Click() MsgBox "saved successfully" End Sub

Private Sub Form_Load()

con.CursorLocation = adUseClient con.Open "Provider=MSDASQL.1;Data Source=oracle1;Persist Security Info=False" rs.Open "select * from IT", con, adOpenDynamic, adLockOptimistic End Sub

Private Sub Text11_GotFocus() Text11.Text = Val(Text10) - Val(Text9)

End Sub

Private Sub Text13_GotFocus() If Val(Text11) < Val(Text12) Then Text13.Text = Text11.Text Else Text13.Text = Text12.Text End If

End Sub

Private Sub Text14_GotFocus() Text14.Text = (Val(Text7) + Val(Text8)) - Val(Text13)

End Sub

Private Sub Text27_GotFocus() Text27.Text = Val(Text14) - 100000

End Sub

Private Sub Text28_GotFocus() Text28.Text = Val(Text27)

End Sub

Private Sub Text29_GotFocus()

If Val(Text6) > 65 Then

If Val(Text28) > 0 And Val(Text28) <= 240000 Then Text29.Text = 0 Text30.Text = 0 End If

If Val(Text28) >= 240001 And Val(Text28) <= 300000 Then Text29.Text = 10 Text30.Text = Val(Text28) * (10 / 100) End If

If Val(Text28) >= 300001 And Val(Text28) <= 500000 Then Text29.Text = 20 Text30.Text = Val(Text28) * (20 / 100) End If

If Val(Text28) > 500000 Then Text29.Text = 30 Text30.Text = Val(Text28) * (30 / 100) End If

End If

If Val(Text6) < 65 Then If Text4.Text = "Female" Or Text4.Text = "female" Then If Val(Text28) > 0 And Val(Text28) <= 190000 Then Text29.Text = 0 Text30.Text = 0 End If

If Val(Text28) >= 190001 And Val(Text28) <= 300000 Then

Text29.Text = 10 Text30.Text = Val(Text28) * (10 / 100) End If

If Val(Text28) >= 300001 And Val(Text28) <= 500000 Then Text29.Text = 20 Text30.Text = Val(Text28) * (20 / 100) End If

If Val(Text28) >= 500001 Then Text29.Text = 30 Text30.Text = Val(Text28) * (30 / 100) End If End If

If Text4.Text = "Male" Or Text4.Text = "male" Then

If Val(Text28) > 0 And Val(Text28) <= 160000 Then Text29.Text = 0 Text30.Text = 0 End If

If Val(Text28) >= 160001 And Val(Text28) <= 300000 Then Text29.Text = 10 Text30.Text = Val(Text28) * (10 / 100)

End If

If Val(Text28) >= 300001 And Val(Text28) <= 500000 Then Text29.Text = 20 Text30.Text = Val(Text28) * (20 / 100) End If

If Val(Text28) >= 500001 Then Text29.Text = 30 Text30.Text = Val(Text28) * (30 / 100) End If End If End If End Sub

Private Sub Text31_GotFocus() Text31.Text = Val(Text16) + Val(Text18) + Val(Text20) + Val(Text22) + Val(Text24) + Val(Text26) End Sub Private Sub Text32_GotFocus() Text32.Text = Val(Text30) * (3 / 100) End Sub Private Sub Text33_GotFocus() Text33.Text = Val(Text30) + Val(Text32) End Sub

Private Sub Text35_GotFocus() Text35.Text = Val(Text33) - Val(Text34) End Sub

Das könnte Ihnen auch gefallen