📄 frm_add_salary_info.frm
字号:
rs.Update
Call clear
ElseIf res = vbNo Then
MsgBox "Modifcation Cancled", vbInformation
End If
End If
rs.Close
End Sub
Private Sub cmd_sal_refresh_Click()
rs.Open "select * from slip where ecode='" & Code & "' ", con, adOpenDynamic, adLockOptimistic
If rs.RecordCount = 0 Then
MsgBox "No Current Records To Refresh", vbInformation, "Alert"
ElseIf rs.RecordCount > 0 Then
With rs
.Requery
.MoveFirst
End With
End If
rs.Close
End Sub
'##ModelId=3CBB305A019D
Private Sub cmd_sal_save_Click()
rs.Open "select * from slip", con, adOpenDynamic, adLockOptimistic
rs.AddNew
Call upload
rs.Update
Call clear
rs.Close
cmd_salary_add.Enabled = True
cmd_sal_save.Enabled = False
End Sub
Private Sub cmd_sal_search_Click()
Dim str_search_number
Code.Enabled = False
str_search_number = InputBox("Enter The Employee Number", "Data Search")
rs.Open "select * from slip", cnPatients, adOpenDynamic, adLockOptimistic
rs.MoveFirst
While Not rs.EOF
If rs.Fields(0) = str_search_number Then
MsgBox "Record Found"
Call download
End If
rs.MoveNext
Wend
Code.Enabled = False
nm.Enabled = False
add.Enabled = False
bp.Enabled = False
desig.Enabled = False
rs.Close
End Sub
'##ModelId=3CBB305A01A6
Private Sub cmd_sal_viewall_Click()
frm_salary_view.Show
End Sub
'##ModelId=3CBB305A01A7
Private Sub cmd_salary_add_Click()
cmd_salary_add.Enabled = False
cmd_sal_save.Enabled = True
Call clear
End Sub
'##ModelId=3CBB305A01B0
Private Sub cmd_salary_back_Click()
Unload Me
frm_employee.Show
End Sub
'##ModelId=3CBB305A01B1
Private Sub Code_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
nm.SetFocus
End If
End Sub
'##ModelId=3CBB305A01BA
Private Sub Code_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If
End Sub
'##ModelId=3CBB305A01BC
Private Sub Command1_Click()
End Sub
'##ModelId=3CBB305A01C4
Private Sub da_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
add.SetFocus
End If
End Sub
'##ModelId=3CBB305A01C7
Private Sub da_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If
End Sub
'##ModelId=3CBB305A01CF
Private Sub da_LostFocus()
gpa.Text = Val(bp.Text) + Val(da.Text) + Val(hr.Text) + Val(ca.Text) + Val(ta.Text)
Net.Text = Val(bp.Text) + Val(da.Text) + Val(hr.Text) + Val(ca.Text) + Val(ta.Text) - Val(pf.Text) - Val(ins.Text) - Val(it.Text) - Val(pt.Text)
End Sub
'##ModelId=3CBB305A01D0
Private Sub deduct_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If
End Sub
'##ModelId=3CBB305A01D9
Private Sub deduct_LostFocus()
deduct.Text = Val(pf.Text) + Val(ins.Text) + Val(it.Text) + Val(pt.Text)
Net.Text = Val(bp.Text) + Val(da.Text) + Val(hr.Text) + Val(ca.Text) + Val(ta.Text) - Val(pf.Text) - Val(ins.Text) - Val(it.Text) - Val(pt.Text)
End Sub
'##ModelId=3CBB305A01DA
Private Sub Desig_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
bp.SetFocus
End If
End Sub
'##ModelId=3CBB305A01E3
Private Sub Desig_KeyPress(KeyAscii As Integer)
If KeyAscii >= 65 And KeyAscii <= 91 Or KeyAscii >= 97 And KeyAscii <= 123 Or KeyAscii = 8 Or KeyAscii = 32 Or KeyAscii = 13 Then
If Len(nm.Text) = 0 Or KeyAscii = 32 Then
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 32 Then
ch = "True"
End If
Else
If ch = "true" Then
KeyAscii = Asc(UCase(Chr(KeyAscii)))
ch = "false"
Else
KeyAscii = Asc(UCase(Chr(KeyAscii)))
End If
End If
Else
MsgBox ("Invalid Input")
KeyAscii = 0
End If
End Sub
'##ModelId=3CBB305A01E5
Private Sub Form_Load()
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
'con.CursorLocation = adUseClient
'con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\pay\Pay.mdb;persist security info=false"
cmd_salary_add.Enabled = True
cmd_sal_save.Enabled = False
Call clear
End Sub
'##ModelId=3CBB305A01ED
Private Sub gpa_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If
End Sub
'##ModelId=3CBB305A01EF
Private Sub gpa_LostFocus()
gpa.Text = Val(bp.Text) + Val(da.Text) + Val(hr.Text) + Val(ca.Text) + Val(ta.Text)
Net.Text = Val(bp.Text) + Val(da.Text) + Val(hr.Text) + Val(ca.Text) + Val(ta.Text) - Val(pf.Text) - Val(ins.Text) - Val(it.Text) - Val(pt.Text)
End Sub
'##ModelId=3CBB305A01F7
Private Sub hr_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
ca.SetFocus
End If
End Sub
'##ModelId=3CBB305A0201
Private Sub hr_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If
End Sub
'##ModelId=3CBB305A0203
Private Sub hr_LostFocus()
gpa.Text = Val(bp.Text) + Val(da.Text) + Val(hr.Text) + Val(ca.Text) + Val(ta.Text)
Net.Text = Val(bp.Text) + Val(da.Text) + Val(hr.Text) + Val(ca.Text) + Val(ta.Text) - Val(pf.Text) - Val(ins.Text) - Val(it.Text) - Val(pt.Text)
End Sub
'##ModelId=3CBB305A020B
Private Sub ins_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
it.SetFocus
End If
End Sub
'##ModelId=3CBB305A020E
Private Sub ins_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If
End Sub
'##ModelId=3CBB305A0215
Private Sub ins_LostFocus()
deduct.Text = Val(pf.Text) + Val(ins.Text) + Val(it.Text) + Val(pt.Text)
Net.Text = Val(bp.Text) + Val(da.Text) + Val(hr.Text) + Val(ca.Text) + Val(ta.Text) - Val(pf.Text) - Val(ins.Text) - Val(it.Text) - Val(pt.Text)
End Sub
'##ModelId=3CBB305A0216
Private Sub it_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
pt.SetFocus
End If
End Sub
'##ModelId=3CBB305A021F
Private Sub it_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If
End Sub
'##ModelId=3CBB305A0221
Private Sub it_LostFocus()
deduct.Text = Val(pf.Text) + Val(ins.Text) + Val(it.Text) + Val(pt.Text)
Net.Text = Val(bp.Text) + Val(da.Text) + Val(hr.Text) + Val(ca.Text) + Val(ta.Text) - Val(pf.Text) - Val(ins.Text) - Val(it.Text) - Val(pt.Text)
End Sub
'##ModelId=3CBB305A0229
Private Sub Net_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If
End Sub
'##ModelId=3CBB305A022B
Private Sub Net_LostFocus()
gpa.Text = Val(bp.Text) + Val(da.Text) + Val(hr.Text) + Val(ca.Text) + Val(ta.Text)
deduct.Text = Val(pf.Text) + Val(ins.Text) + Val(it.Text) + Val(pt.Text)
Net.Text = Val(bp.Text) + Val(da.Text) + Val(hr.Text) + Val(ca.Text) + Val(ta.Text) - Val(pf.Text) - Val(ins.Text) - Val(it.Text) - Val(pt.Text)
End Sub
'##ModelId=3CBB305A0233
Private Sub nm_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
add.SetFocus
End If
End Sub
'##ModelId=3CBB305A023D
Private Sub nm_KeyPress(KeyAscii As Integer)
If KeyAscii >= 65 And KeyAscii <= 91 Or KeyAscii >= 97 And KeyAscii <= 123 Or KeyAscii = 8 Or KeyAscii = 32 Or KeyAscii = 13 Then
If Len(nm.Text) = 0 Or KeyAscii = 32 Then
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 32 Then
ch = "True"
End If
Else
If ch = "true" Then
KeyAscii = Asc(UCase(Chr(KeyAscii)))
ch = "false"
Else
KeyAscii = Asc(UCase(Chr(KeyAscii)))
End If
End If
Else
MsgBox ("Invalid Input")
KeyAscii = 0
End If
End Sub
'##ModelId=3CBB305A023F
Private Sub pf_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
ins.SetFocus
End If
End Sub
'##ModelId=3CBB305A0247
Private Sub pf_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If
End Sub
'##ModelId=3CBB305A0249
Private Sub pf_LostFocus()
deduct.Text = Val(pf.Text) + Val(ins.Text) + Val(it.Text) + Val(pt.Text)
Net.Text = Val(bp.Text) + Val(da.Text) + Val(hr.Text) + Val(ca.Text) + Val(ta.Text) - Val(pf.Text) - Val(ins.Text) - Val(it.Text) - Val(pt.Text)
End Sub
'##ModelId=3CBB305A0251
Private Sub pt_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
cmd_salary_add.SetFocus
End If
End Sub
'##ModelId=3CBB305A025B
Private Sub pt_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If
End Sub
'##ModelId=3CBB305A025D
Private Sub pt_LostFocus()
deduct.Text = Val(pf.Text) + Val(ins.Text) + Val(it.Text) + Val(pt.Text)
Net.Text = Val(bp.Text) + Val(da.Text) + Val(hr.Text) + Val(ca.Text) + Val(ta.Text) - Val(pf.Text) - Val(ins.Text) - Val(it.Text) - Val(pt.Text)
End Sub
'##ModelId=3CBB305A0265
Private Sub ta_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
pf.SetFocus
End If
End Sub
'##ModelId=3CBB305A0268
Private Sub ta_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If
End Sub
'##ModelId=3CBB305A026F
Private Sub ta_LostFocus()
gpa.Text = Val(bp.Text) + Val(da.Text) + Val(hr.Text) + Val(ca.Text) + Val(ta.Text)
Net.Text = Val(bp.Text) + Val(da.Text) + Val(hr.Text) + Val(ca.Text) + Val(ta.Text) - Val(pf.Text) - Val(ins.Text) - Val(it.Text) - Val(pt.Text)
End Sub
Public Sub clear()
Me.Code.Text = ""
Me.nm.Text = ""
Me.add.Text = ""
Me.desig.Text = ""
Me.bp.Text = ""
Me.da.Text = ""
Me.hr.Text = ""
Me.ca.Text = ""
Me.ta.Text = ""
Me.pf.Text = ""
Me.ins.Text = ""
Me.it.Text = ""
Me.pt.Text = ""
Me.gpa.Text = ""
Me.deduct.Text = ""
Me.Net.Text = ""
End Sub
Public Sub upload()
rs!ecode = Me.Code.Text
rs!name = Me.nm.Text
rs!dep = Me.desig.Text
rs!address = Me.add.Text
rs!basic = Me.bp.Text
rs!da = Me.da.Text
rs!hra = Me.hr.Text
rs!cca = Me.ca.Text
rs!trans = Me.ta.Text
rs!gpf = Me.pf.Text
rs!ins = Me.ins.Text
rs!itax = Me.it.Text
rs!ptax = Me.pt.Text
rs!gross = Me.gpa.Text
rs!deduct = Me.deduct.Text
rs!Net = Me.Net.Text
End Sub
Public Sub download()
With frm_add_salary_info
.Code.Text = rs!ecode
.nm.Text = rs!name
.desig.Text = rs!dep
.add.Text = rs!address
.bp.Text = rs!basic
.da.Text = rs!da
.hr.Text = rs!hra
.ca.Text = rs!cca
.ta.Text = rs!trans
.pf.Text = rs!gpf
.ins.Text = rs!ins
.it.Text = rs!itax
.pt.Text = rs!ptax
.gpa.Text = rs!gross
.deduct.Text = rs!deduct
.Net.Text = rs!Net
End With
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -