📄 frmtitlewage.frm
字号:
VERSION 5.00
Begin VB.Form TitleWage
BorderStyle = 1 'Fixed Single
Caption = "职称工资标准管理"
ClientHeight = 1695
ClientLeft = 45
ClientTop = 330
ClientWidth = 5310
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 1695
ScaleWidth = 5310
Begin VB.TextBox txtWage
Height = 300
Index = 4
Left = 3368
TabIndex = 4
Top = 690
Width = 1125
End
Begin VB.CommandButton cmdExit
Cancel = -1 'True
Caption = "关闭"
Height = 300
Left = 3728
TabIndex = 6
Top = 1080
Width = 720
End
Begin VB.CommandButton cmdSave
Caption = "保存"
Default = -1 'True
Height = 300
Left = 2888
TabIndex = 5
Top = 1080
Width = 720
End
Begin VB.TextBox txtWage
Height = 300
Index = 3
Left = 3368
TabIndex = 3
Top = 315
Width = 1125
End
Begin VB.TextBox txtWage
Height = 300
Index = 2
Left = 1328
TabIndex = 2
Top = 1080
Width = 1125
End
Begin VB.TextBox txtWage
Height = 300
Index = 1
Left = 1328
TabIndex = 1
Top = 690
Width = 1125
End
Begin VB.TextBox txtWage
Height = 300
Index = 0
Left = 1328
TabIndex = 0
Top = 315
Width = 1125
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "普通"
Height = 180
Left = 2858
TabIndex = 11
Top = 750
Width = 360
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "初级"
Height = 180
Left = 2873
TabIndex = 10
Top = 375
Width = 360
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "中级"
Height = 180
Left = 818
TabIndex = 9
Top = 1140
Width = 360
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "副高"
Height = 180
Left = 833
TabIndex = 8
Top = 750
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "正高"
Height = 180
Left = 818
TabIndex = 7
Top = 375
Width = 360
End
End
Attribute VB_Name = "TitleWage"
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
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
For j = 0 To 4
.Fields(j) = txtWage(j)
Next
.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 + -