📄 其他工资标准管理.frm
字号:
VERSION 5.00
Begin VB.Form ElseWage
Caption = "其他工资标准管理"
ClientHeight = 5790
ClientLeft = 60
ClientTop = 450
ClientWidth = 6405
LinkTopic = "Form2"
MDIChild = -1 'True
ScaleHeight = 5790
ScaleWidth = 6405
Begin VB.CommandButton cmdExit
Cancel = -1 'True
Caption = "关闭"
Height = 375
Left = 3480
TabIndex = 3
Top = 4920
Width = 1815
End
Begin VB.CommandButton cmdSave
Caption = "保存"
Default = -1 'True
Height = 375
Left = 720
TabIndex = 2
Top = 4920
Width = 1815
End
Begin VB.Frame Frame2
Caption = "应扣工资"
Height = 2295
Left = 240
TabIndex = 1
Top = 2160
Width = 5775
Begin VB.TextBox txtDE
Height = 375
Index = 5
Left = 3840
TabIndex = 23
Top = 1560
Width = 1335
End
Begin VB.TextBox txtDE
Height = 375
Index = 4
Left = 3840
TabIndex = 22
Top = 840
Width = 1335
End
Begin VB.TextBox txtDE
Height = 375
Index = 3
Left = 3840
TabIndex = 21
Top = 240
Width = 1335
End
Begin VB.TextBox txtDE
Height = 375
Index = 2
Left = 1080
TabIndex = 20
Top = 1560
Width = 1335
End
Begin VB.TextBox txtDE
Height = 375
Index = 1
Left = 1080
TabIndex = 19
Top = 960
Width = 1335
End
Begin VB.TextBox txtDE
Height = 375
Index = 0
Left = 1080
TabIndex = 18
Top = 360
Width = 1335
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "其他"
Height = 180
Left = 3240
TabIndex = 13
Top = 1680
Width = 360
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "房租"
Height = 180
Left = 3240
TabIndex = 12
Top = 1080
Width = 360
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "垃圾费"
Height = 180
Left = 3060
TabIndex = 11
Top = 360
Width = 540
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "医疗险"
Height = 180
Left = 240
TabIndex = 10
Top = 1560
Width = 540
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "失业险"
Height = 180
Left = 240
TabIndex = 9
Top = 1080
Width = 540
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "公积金"
Height = 180
Left = 240
TabIndex = 8
Top = 480
Width = 540
End
End
Begin VB.Frame Frame1
Caption = "应发工资"
Height = 1575
Left = 240
TabIndex = 0
Top = 360
Width = 5775
Begin VB.TextBox txtSE
Height = 375
Index = 3
Left = 3840
TabIndex = 17
Top = 960
Width = 1215
End
Begin VB.TextBox txtSE
Height = 375
Index = 2
Left = 3840
TabIndex = 16
Top = 240
Width = 1215
End
Begin VB.TextBox txtSE
Height = 375
Index = 1
Left = 1080
TabIndex = 15
Top = 960
Width = 1215
End
Begin VB.TextBox txtSE
Height = 375
Index = 0
Left = 1080
TabIndex = 14
Top = 240
Width = 1215
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "其他补贴"
Height = 180
Left = 2880
TabIndex = 7
Top = 1080
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "一次性补发"
Height = 180
Left = 2700
TabIndex = 6
Top = 360
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "住房补贴"
Height = 180
Left = 240
TabIndex = 5
Top = 1080
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "专家津贴"
Height = 180
Left = 240
TabIndex = 4
Top = 360
Width = 720
End
End
End
Attribute VB_Name = "ElseWage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim isAdding As Boolean
Dim objCn As Connection, objRs As Recordset
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdSave_Click()
On Error GoTo DealError
StrNews1 = Array("专家津贴", "住房补贴", "一次性补发", "其他补贴")
StrNews2 = Array("公积金", "失业险", "医疗险", "垃圾费", "房租", "其他")
For i = 0 To 3 '验证设定的工资标准
If txtSE(i) = "" Or Not IsNumeric(txtSE(i)) Then
MsgBox "应发" & StrNews1(i) & "工资标准不能为空,且必须为数字!", vbCritical, "职务工资标准设定"
txtSE(i).SetFocus
txtSE(i).SelStart = 0
txtSE(i).SelLength = Len(txtSE(i))
Exit Sub
End If
Next
For i = 0 To 5
If txtDE(i) = "" Or Not IsNumeric(txtDE(i)) Then
MsgBox "应扣" & StrNews2(i) & "工资标准不能为空,且必须为数字!", vbCritical, "职务工资标准设定"
txtDE(i).SetFocus
txtDE(i).SelStart = 0
txtDE(i).SelLength = Len(txtDE(i))
Exit Sub
End If
Next
If objRs.RecordCount = 0 Then objRs.AddNew
For i = 0 To 3
objRs.Fields(i) = txtSE(i)
Next
For i = 0 To 5
objRs.Fields(i + 4) = txtDE(i)
Next
objRs.Update
MsgBox "数据保存成功!", vbInformation, "其他工资标准设定"
Exit Sub
DealError:
msg = "程序执行出错,错误信息如下:" & vbCrLf & Err.Description
ShowError msg
End Sub
Private Sub Form_Load()
On Error GoTo DealError
'建立数据库连接
Set objCn = New Connection
strcn = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\工资管理.mdb"
objCn.ConnectionString = strcn
objCn.Open
'创建Recordset对象,获取系统用户数据
Set objRs = New Recordset
Set objRs.ActiveConnection = objCn
objRs.CursorLocation = adUseClient
objRs.CursorType = adOpenDynamic
objRs.LockType = adLockOptimistic
Strsql = "SELECT * FROM 其他工资"
objRs.Open Strsql
' 显示数据
If objRs.BOF And objRs.EOF Then
MsgBox "无记录"
Else
For i = 0 To 3
txtSE(i) = objRs.Fields(i)
Next
For i = 0 To 5
txtDE(i) = objRs.Fields(i + 4)
Next
End If
Exit Sub
DealError:
msg = "程序执行出错,错误信息如下:" & vbCrLf & Err.Description
ShowError msg
End Sub
Private Sub Form_Unload(Cancel As Integer) '关闭数据库连接,释放ADO
Set objRs = Nothing
objCn.Close
Set objCn = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -