?? frmresult.frm
字號:
Set rs = getrs(strquery, "salary")
If rs.RecordCount = 0 Then
MsgBox "沒有工資設置", vbOKOnly + vbExclamation, "提示"
frmbasicsetting.Show
frmbasicsetting.ZOrder 0
Else
With Me.MSFlexGrid2
.Rows = 1
While Not rs.EOF
.Rows = .Rows + 1
.TextMatrix(.Rows - 1, 0) = rs(0)
.TextMatrix(.Rows - 1, 1) = rs(1)
sql = "select sname from stuffinfo where sid='" & rs(1) & "'"
Set rs1 = getrs(sql, "salary")
.TextMatrix(.Rows - 1, 2) = rs1(0)
rs1.Close
.TextMatrix(.Rows - 1, 3) = rs(2)
.TextMatrix(.Rows - 1, 4) = rs(3) & "元"
rs.MoveNext
Wend
End With
rs.Close
End If
End Sub
Private Sub cmdcheckall_Click()
Dim sql As String
If Trim(strusername) <> "admin" Then
MsgBox "您沒有這個權限!", vbOKOnly + vbExclamation, "警告"
Exit Sub
Else
Select Case Me.SSTab1.Tab
Case 0
sql = "select * from salarysetting"
Call basictopic
Call showbasic(sql)
Case 1
sql = "select * from salaryother"
Call othertopic
Call showother(sql)
Case 2
sql = "select * from salarystatistics order by id desc"
Call listtopic
Call showdata(sql)
End Select
End If
iclickflag = 2
End Sub
Private Sub cmdok_Click()
Dim sql As String
If Trim(strusername) <> "admin" Then
MsgBox "您沒有這個權限!", vbOKOnly + vbExclamation, "警告"
Exit Sub
Else
Select Case Me.SSTab1.Tab
Case 0
sql = "select * from salarysetting where stuffid='" & Me.comid.Text & "'"
Call basictopic
Call showbasic(sql)
Case 1
sql = "select * from salaryother where stuffid='" & Me.comid.Text & "'"
Call othertopic
Call showother(sql)
Case 2
sql = "select * from salarystatistics where stuffid='" & Me.comid.Text & "'"
Call listtopic
Call showdata(sql)
End Select
End If
iclickflag = 1
End Sub
Public Sub listtopic()
Dim i As Integer
With Me.MSFlexGrid1 '設置表頭
.TextMatrix(0, 0) = "記錄編號"
.TextMatrix(0, 1) = "員工編號"
.TextMatrix(0, 2) = "員工姓名"
.TextMatrix(0, 3) = "統計日期"
.TextMatrix(0, 4) = "基本工資"
.TextMatrix(0, 5) = "獎 金"
.TextMatrix(0, 6) = "福 利"
.TextMatrix(0, 7) = "津 貼"
.TextMatrix(0, 8) = "扣 發"
.TextMatrix(0, 9) = "遲到早退"
.TextMatrix(0, 10) = "曠工扣發"
.TextMatrix(0, 11) = "加班費"
.TextMatrix(0, 12) = "出差費"
.TextMatrix(0, 13) = "其 他"
.TextMatrix(0, 14) = "總 額"
For i = 0 To 14 '設置所有表格對齊方式
.ColAlignment(i) = 4
Next i
For i = 0 To 14 '設置每列寬度
.ColWidth(i) = 1000
Next i
End With
End Sub
Public Sub showdata(strquery As String)
Dim rs As New ADODB.Recordset
Set rs = getrs(strquery, "salary")
If rs.EOF = False Then
With Me.MSFlexGrid1
.Rows = 1
While Not rs.EOF
.Rows = .Rows + 1
.TextMatrix(.Rows - 1, 0) = rs(0)
.TextMatrix(.Rows - 1, 1) = rs(1)
.TextMatrix(.Rows - 1, 2) = rs(2)
.TextMatrix(.Rows - 1, 3) = rs(3)
.TextMatrix(.Rows - 1, 4) = rs(4) & "元"
.TextMatrix(.Rows - 1, 5) = rs(5) & "元"
.TextMatrix(.Rows - 1, 6) = rs(6) & "元"
.TextMatrix(.Rows - 1, 7) = rs(7) & "元"
.TextMatrix(.Rows - 1, 8) = rs(8) & "元"
.TextMatrix(.Rows - 1, 9) = rs(9) & "元"
.TextMatrix(.Rows - 1, 10) = rs(10) & "元"
.TextMatrix(.Rows - 1, 11) = rs(11) & "元"
.TextMatrix(.Rows - 1, 12) = rs(12) & "元"
.TextMatrix(.Rows - 1, 13) = rs(13) & "元"
.TextMatrix(.Rows - 1, 14) = rs(14) & "元"
rs.MoveNext
Wend
End With
rs.Close
End If
End Sub
Public Sub othertopic()
Dim i As Integer
With Me.MSFlexGrid3 '設置表頭
.TextMatrix(0, 0) = "記錄編號"
.TextMatrix(0, 1) = "員工編號"
.TextMatrix(0, 2) = "員工姓名"
.TextMatrix(0, 3) = "添加日期"
.TextMatrix(0, 4) = "名 稱"
.TextMatrix(0, 5) = "金 額"
.TextMatrix(0, 6) = "備 注"
For i = 0 To 6 '設置所有表格對齊方式
.ColAlignment(i) = 4
Next i
For i = 0 To 6 '設置每列寬度
.ColWidth(i) = 1000
Next i
End With
End Sub
Public Sub showother(strquery As String)
Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Dim sql As String
Set rs = getrs(strquery, "salary")
If rs.EOF = False Then
With Me.MSFlexGrid3
.Rows = 1
While Not rs.EOF
.Rows = .Rows + 1
.TextMatrix(.Rows - 1, 0) = rs(0)
.TextMatrix(.Rows - 1, 1) = rs(1)
sql = "select sname from stuffinfo where sid='" & rs(1) & "'"
Set rs1 = getrs(sql, "salary")
.TextMatrix(.Rows - 1, 2) = rs1(0)
rs1.Close
.TextMatrix(.Rows - 1, 3) = rs(2)
.TextMatrix(.Rows - 1, 4) = rs(4)
.TextMatrix(.Rows - 1, 5) = rs(5) & "元"
.TextMatrix(.Rows - 1, 6) = rs(6)
rs.MoveNext
Wend
End With
rs.Close
End If
End Sub
Private Sub MSFlexGrid2_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If Shift = 0 And Button = 2 Then
PopupMenu frmpopmenu.Popmenu
End If
End Sub
Private Sub MSFlexGrid3_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If Shift = 0 And Button = 2 Then
PopupMenu frmpopmenu.Popmenu2
End If
End Sub
Private Sub SSTab1_Click(PreviousTab As Integer)
Dim sql As String
Dim rs As New ADODB.Recordset
If strusername = "admin" Then
If iclickflag = 1 Then
Select Case Me.SSTab1.Tab
Case 0
sql = "select * from salarysetting where stuffid='" & Me.comid.Text & "'"
Call basictopic
Call showbasic(sql)
Case 1
sql = "select * from salaryother where stuffid='" & Me.comid.Text & "'"
Call othertopic
Call showother(sql)
Case 2
sql = "select * from salarystatistics where stuffid='" & Me.comid.Text & "'"
Call listtopic
Call showdata(sql)
End Select
Else
Select Case Me.SSTab1.Tab
Case 0
sql = "select * from salarysetting"
Call basictopic
Call showbasic(sql)
Case 1
sql = "select * from salaryother"
Call othertopic
Call showother(sql)
Case 2
sql = "select * from salarystatistics order by id desc"
Call listtopic
Call showdata(sql)
End Select
End If
Else
sql = "select sid from stuffinfo where sname='" & strusername & "'"
Set rs = getrs(sql, "salary")
While Not rs.EOF
Me.comid.AddItem rs(0)
rs.MoveNext
Wend
rs.MoveFirst
sd = rs(0)
rs.Close
Me.comid.ListIndex = 0
Select Case Me.SSTab1.Tab
Case 0
sql = "select * from salarysetting where stuffid='" & sd & "' "
Call basictopic
Call showbasic(sql)
Case 1
sql = "select * from salaryother where stuffid='" & sd & "'"
Call othertopic
Call showother(sql)
Case 2
sql = "select * from salarystatistics where stuffid='" & sd & "'"
Call listtopic
Call showdata(sql)
End Select
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -