📄 frmelsewage.frm
字号:
VERSION 5.00
Begin VB.Form ElseWage
BorderStyle = 1 'Fixed Single
Caption = "其他工资标准管理"
ClientHeight = 3945
ClientLeft = 45
ClientTop = 330
ClientWidth = 5760
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 3945
ScaleWidth = 5760
Begin VB.Frame Frame2
Caption = "应扣工资"
Height = 1515
Left = 368
TabIndex = 9
Top = 1635
Width = 5025
Begin VB.TextBox txtDE
Height = 270
Index = 5
Left = 3480
TabIndex = 23
Top = 1020
Width = 1110
End
Begin VB.TextBox txtDE
Height = 270
Index = 4
Left = 3480
TabIndex = 21
Top = 660
Width = 1110
End
Begin VB.TextBox txtDE
Height = 270
Index = 3
Left = 3480
TabIndex = 19
Top = 330
Width = 1110
End
Begin VB.TextBox txtDE
Height = 270
Index = 2
Left = 1095
TabIndex = 17
Top = 1065
Width = 1110
End
Begin VB.TextBox txtDE
Height = 270
Index = 1
Left = 1095
TabIndex = 15
Top = 690
Width = 1110
End
Begin VB.TextBox txtDE
Height = 270
Index = 0
Left = 1095
TabIndex = 13
Top = 330
Width = 1110
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "其他"
Height = 180
Left = 2970
TabIndex = 22
Top = 1065
Width = 360
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "垃圾费"
Height = 180
Left = 2880
TabIndex = 20
Top = 360
Width = 540
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "医疗险"
Height = 180
Left = 480
TabIndex = 18
Top = 1095
Width = 540
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "失业险"
Height = 180
Left = 510
TabIndex = 16
Top = 735
Width = 540
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "房租"
Height = 180
Left = 2985
TabIndex = 14
Top = 705
Width = 360
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "公积金"
Height = 180
Left = 495
TabIndex = 12
Top = 375
Width = 540
End
End
Begin VB.Frame Frame1
Caption = "应发工资"
Height = 1185
Left = 368
TabIndex = 2
Top = 307
Width = 5025
Begin VB.TextBox txtSE
Height = 270
Index = 3
Left = 3570
TabIndex = 11
Top = 705
Width = 1125
End
Begin VB.TextBox txtSE
Height = 270
Index = 2
Left = 3570
TabIndex = 8
Top = 315
Width = 1125
End
Begin VB.TextBox txtSE
Height = 270
Index = 1
Left = 1050
TabIndex = 7
Top = 705
Width = 1125
End
Begin VB.TextBox txtSE
Height = 270
Index = 0
Left = 1050
TabIndex = 6
Top = 315
Width = 1125
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "住房补贴"
Height = 180
Left = 240
TabIndex = 10
Top = 750
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "其他补贴"
Height = 180
Left = 2775
TabIndex = 5
Top = 750
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "一次性补发"
Height = 180
Left = 2595
TabIndex = 4
Top = 360
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "专家津贴"
Height = 180
Left = 240
TabIndex = 3
Top = 360
Width = 720
End
End
Begin VB.CommandButton cmdExit
Cancel = -1 'True
Caption = "关闭"
Height = 300
Left = 3308
TabIndex = 1
Top = 3337
Width = 720
End
Begin VB.CommandButton cmdSave
Caption = "保存"
Default = -1 'True
Height = 300
Left = 1733
TabIndex = 0
Top = 3337
Width = 720
End
End
Attribute VB_Name = "ElseWage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim objRs As Recordset, objCn As Connection
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 "应扣" & strNews1(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
'显示数据
For i = 0 To 3
txtSE(i) = objRs.Fields(i)
Next
For i = 0 To 5
txtDE(i) = objRs.Fields(i + 4)
Next
Exit Sub
DealError:
msg = "程序执行出错,错误信息如下:" & vbCrLf & Err.Description
ShowError msg
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set objRs = Nothing
objCn.Close
Set objCn = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -