📄 frmdutywage.frm
字号:
VERSION 5.00
Begin VB.Form DutyWage
BorderStyle = 1 'Fixed Single
Caption = "职务工资标准管理"
ClientHeight = 1890
ClientLeft = 45
ClientTop = 330
ClientWidth = 5505
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 1890
ScaleWidth = 5505
Begin VB.TextBox txtWage
BeginProperty DataFormat
Type = 1
Format = """¥""#,##0.00;(""¥""#,##0.00)"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 2
EndProperty
Height = 300
Index = 4
Left = 1121
TabIndex = 10
Top = 1230
Width = 1575
End
Begin VB.CommandButton cmdExit
Cancel = -1 'True
Caption = "关闭"
Height = 300
Left = 4099
TabIndex = 5
Top = 1230
Width = 720
End
Begin VB.CommandButton cmdSave
Caption = "保存"
Default = -1 'True
Height = 300
Left = 3079
TabIndex = 4
Top = 1230
Width = 720
End
Begin VB.TextBox txtWage
BeginProperty DataFormat
Type = 1
Format = """¥""#,##0.00;(""¥""#,##0.00)"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 2
EndProperty
Height = 300
Index = 3
Left = 3555
TabIndex = 3
Top = 840
Width = 1575
End
Begin VB.TextBox txtWage
BeginProperty DataFormat
Type = 1
Format = """¥""#,##0.00;(""¥""#,##0.00)"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 2
EndProperty
Height = 300
Index = 2
Left = 3521
TabIndex = 2
Top = 360
Width = 1575
End
Begin VB.TextBox txtWage
BeginProperty DataFormat
Type = 1
Format = """¥""#,##0.00;(""¥""#,##0.00)"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 2
EndProperty
Height = 300
Index = 1
Left = 1121
TabIndex = 1
Top = 795
Width = 1575
End
Begin VB.TextBox txtWage
BeginProperty DataFormat
Type = 1
Format = """¥""#,##0.00;(""¥""#,##0.00)"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 2
EndProperty
Height = 300
Index = 0
Left = 1121
TabIndex = 0
Top = 360
Width = 1575
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "一 般"
Height = 180
Left = 409
TabIndex = 11
Top = 1290
Width = 540
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "副科级"
Height = 180
Left = 2816
TabIndex = 9
Top = 855
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "正科级"
Height = 180
Left = 2816
TabIndex = 8
Top = 420
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "副处级"
Height = 180
Left = 416
TabIndex = 7
Top = 855
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "正处级"
Height = 180
Left = 416
TabIndex = 6
Top = 420
Width = 540
End
End
Attribute VB_Name = "DutyWage"
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
.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 + -