📄 职称工资标准管理.frm
字号:
VERSION 5.00
Begin VB.Form TitleManage
Caption = "职称工资标准管理"
ClientHeight = 3675
ClientLeft = 60
ClientTop = 450
ClientWidth = 6915
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 3675
ScaleWidth = 6915
Begin VB.TextBox txtWage
Height = 495
Index = 2
Left = 1440
TabIndex = 11
Top = 2640
Width = 1215
End
Begin VB.CommandButton cmdExit
Cancel = -1 'True
Caption = "关闭"
Height = 495
Left = 4800
TabIndex = 10
Top = 2640
Width = 1215
End
Begin VB.CommandButton cmdSave
Caption = "保存"
Default = -1 'True
Height = 495
Left = 3120
TabIndex = 9
Top = 2640
Width = 1215
End
Begin VB.TextBox txtWage
Height = 495
Index = 1
Left = 4680
TabIndex = 8
Top = 1560
Width = 1215
End
Begin VB.TextBox txtWage
Height = 495
Index = 0
Left = 4680
TabIndex = 7
Top = 480
Width = 1215
End
Begin VB.TextBox txtWage
Height = 495
Index = 4
Left = 1440
TabIndex = 6
Top = 480
Width = 1215
End
Begin VB.TextBox txtWage
Height = 495
Index = 3
Left = 1440
TabIndex = 5
Top = 1560
Width = 1215
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "普通:"
Height = 180
Left = 600
TabIndex = 4
Top = 2880
Width = 540
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "初级:"
Height = 180
Left = 3600
TabIndex = 3
Top = 1800
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "中级:"
Height = 180
Left = 3600
TabIndex = 2
Top = 600
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "副高:"
Height = 180
Left = 600
TabIndex = 1
Top = 1800
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "正高:"
Height = 180
Left = 600
TabIndex = 0
Top = 600
Width = 540
End
End
Attribute VB_Name = "TitleManage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim objCn As Connection, objRs As Recordset
'objCn用于建立数据库连接,objRs用于保存"职称工资"表数据
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdSave_Click()
On Error GoTo DealError
strNews = Array("正高", "副高", "中级", "初级", "普通")
For i = 0 To 4 '验证设定的工资标准
If txtWage(i) = "" Or Not IsNumeric(txtWage(i)) Then
MsgBox strNews(i) & "级工资标准不能为空,且必须为数字!", vbCritical, "职务工资标准设定"
txtWage(i).SetFocus
txtWage(i).SelStart = 0
txtWage(i).SelLength = Len(txtWage(i))
Exit Sub
End If
Next
With objRs '保存工资标准
If .RecordCount = 0 Then .AddNew
.Fields("正高") = txtWage(0)
.Fields("副高") = txtWage(1)
.Fields("中级") = txtWage(2)
.Fields("初级") = txtWage(3)
.Fields("普通") = txtWage(4)
.Update
End With
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 4
txtWage(i) = objRs.Fields(i)
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 + -