个人工资查询.frm
来自「企业工资管理系统的主要任务是用计算机对各种工资信息进行日常的管理」· FRM 代码 · 共 519 行 · 第 1/2 页
FRM
519 行
End
Begin VB.CommandButton cmdExit
Cancel = -1 'True
Caption = "关闭"
Height = 255
Left = 5280
TabIndex = 12
Top = 720
Width = 975
End
Begin VB.CommandButton cmdQuery
Caption = "查询"
Default = -1 'True
Height = 255
Left = 4680
TabIndex = 11
Top = 240
Width = 975
End
Begin VB.PictureBox picNavigation
Height = 375
Left = 240
ScaleHeight = 315
ScaleWidth = 6075
TabIndex = 5
Top = 1200
Width = 6135
Begin VB.CommandButton cmdMove
Caption = ">|"
Height = 375
Index = 3
Left = 5520
TabIndex = 10
Top = 0
Width = 375
End
Begin VB.CommandButton cmdMove
Caption = ">"
Height = 375
Index = 2
Left = 5160
TabIndex = 9
Top = 0
Width = 375
End
Begin VB.TextBox txtNews
Height = 375
Left = 840
TabIndex = 8
Top = 0
Width = 4335
End
Begin VB.CommandButton cmdMove
Caption = "<"
Height = 375
Index = 1
Left = 480
TabIndex = 7
Top = 0
Width = 375
End
Begin VB.CommandButton cmdMove
Caption = "|<"
Height = 375
Index = 0
Left = 120
TabIndex = 6
Top = 0
Width = 375
End
End
Begin VB.OptionButton Option2
Caption = "编号"
Height = 255
Left = 3480
TabIndex = 4
Top = 240
Width = 735
End
Begin VB.OptionButton Option1
Caption = "姓名"
Height = 255
Left = 1920
TabIndex = 3
Top = 240
Value = -1 'True
Width = 735
End
Begin VB.TextBox txtKey
Height = 270
Left = 1680
TabIndex = 2
Top = 675
Width = 2535
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "实发工资:"
Height = 180
Left = 240
TabIndex = 13
Top = 1920
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "输入查询条件:"
Height = 180
Left = 240
TabIndex = 1
Top = 720
Width = 1260
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "选择查询方式:"
Height = 180
Left = 240
TabIndex = 0
Top = 240
Width = 1260
End
End
Attribute VB_Name = "QueryWage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim objRsFoot As Recordset '用于保存"工资结算"数据表
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdMove_Click(Index As Integer)
On Error GoTo DealError
With objRsFoot
If .State = adStateClosed Then .Open
If .BOF And EOF Then '显示查询结果提示
txtNews = "查询结果:无符合条件的记录"
Else
txtNews = "查询结果:" & .AbsolutePosition & "/" & .RecordCount
End If
Select Case Index '切换当前记录
Case 0 '使第一个记录为当前记录
If .RecordCount > 0 And Not .BOF Then .MoveFirst
Case 1 '使上一个记录为当前记录
If .RecordCount > 0 And Not .BOF Then
.MovePrevious
If .BOF Then .MoveFirst
End If
Case 2 '使下一个记录为当前记录
If .RecordCount > 0 And Not .EOF Then
.MoveNext
If .EOF Then .MoveLast
End If
Case 3
If .RecordCount > 0 And Not .EOF Then .MoveLast
End Select
ShowWage
End With
Exit Sub
DealError:
msg = "程序执行出错,错误信息如下:" & bCrLf & Err.Description
ShowError msg
End Sub
'定义过程ShowWage ---显示当前记录
Private Sub ShowWage()
On Error GoTo DealError
With objRsFoot
If .RecordCount > 0 Then
txtHouse = .Fields("房帖")
txtDG = .Fields("扣公积金")
txtDS = .Fields("扣失业险")
txtDY = .Fields("扣医疗险")
txtDF = .Fields("扣房租")
txtDutyWage = .Fields("职务工资")
txtTitleWage = .Fields("职称工资")
txtExpert = .Fields("专家津贴")
txtOnce = .Fields("一次性补发")
txtElse = .Fields("其他补贴")
txtDL = .Fields("扣垃圾费")
txtDQ = .Fields("扣其他")
txtSGet = .Fields("应发合计")
txtDD = .Fields("应扣合计")
txtGet = .Fields("应发合计")
txtNews = "记录:" & objRsStuff.AbsolutePosition & "/" & objRsStuff.RecordCount & "结算数据已保存"
Label3 = .Field("姓名") & " " & .Fields("编号") & " " & .Fields("部门")
Else
'在无查询结果时清除各个工资数据项
txtGet = " ": txtExpert = " ": txtSingle = " "
txtHouse = " ": txtDutyWage = " ": txtTitleWage = " "
txtOnce = " ": txtElse = " ": txtSGet = " "
txtDG = " ": txtDS = " ": txtDD = " "
txtDQ = " ": txtDY = " ": txtDF = " ": Label3 = " "
End If
End With
DealError:
msg = "程序执行出错,错误信息如下:" & vbCrLf & Err.Description
ShowError msg
End Sub
Private Sub cmdQuery_Click()
With objRsFoot
If txtKey <> "" Then
If optName.Value Then
.Filter = "姓名 LIKE '*" & txtKey & "*'"
Else
.Filter = "编号 LIKE '*" & txtKey & "*'"
End If
Else
.Filter = ""
End If
End With
cmdMove(0).Value = True
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 objRsFoot = New Recordset
Set objRs.ActiveConnection = objCn
objRsFoot.CursorLocation = adUseClient
objRsFoot.Open "SELECT * FROM 工资结算"
objRsFoot.Filter = "姓名 LIKE '$^%&&&*'"
Label3 = ""
Exit Sub
DealError:
msg = "程序执行出错,错误信息如下:" & vbCrLf & Err.Description
ShowError msg
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set objRsFoot = Nothing
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?