📄 frm_kqinfofind.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "Msflxgrd.ocx"
Begin VB.Form Frm_KQInfoFind
Caption = "考勤信息查询"
ClientHeight = 8520
ClientLeft = 60
ClientTop = 345
ClientWidth = 10275
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 8520
ScaleWidth = 10275
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame5
Caption = "上下班信息"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1995
Left = 90
TabIndex = 12
Top = 1050
Width = 10095
Begin MSFlexGridLib.MSFlexGrid Grid4
Height = 1635
Left = 180
TabIndex = 13
Top = 270
Width = 9735
_ExtentX = 17171
_ExtentY = 2884
_Version = 393216
Cols = 8
FixedCols = 0
AllowUserResizing= 1
Appearance = 0
End
End
Begin VB.Frame Frame2
Caption = "请假信息"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1815
Left = 90
TabIndex = 10
Top = 3120
Width = 10095
Begin MSFlexGridLib.MSFlexGrid Grid1
Height = 1425
Left = 180
TabIndex = 11
Top = 270
Width = 9735
_ExtentX = 17171
_ExtentY = 2514
_Version = 393216
Cols = 4
FixedCols = 0
AllowUserResizing= 1
Appearance = 0
End
End
Begin VB.Frame Frame1
Height = 1035
Left = 90
TabIndex = 4
Top = 0
Width = 10095
Begin VB.CommandButton Cmd_OK
Caption = " 查 询"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 8250
TabIndex = 7
Top = 300
Width = 1455
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 4890
TabIndex = 6
Top = 360
Width = 2325
End
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1500
TabIndex = 5
Top = 360
Width = 1965
End
Begin VB.Label Label1
Caption = "选择查询内容"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 1
Left = 3570
TabIndex = 9
Top = 420
Width = 1335
End
Begin VB.Label Label1
Caption = "选择查询字段"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 0
Left = 180
TabIndex = 8
Top = 420
Width = 1335
End
End
Begin VB.Frame Frame3
Caption = "加班信息"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1725
Left = 90
TabIndex = 2
Top = 4950
Width = 10095
Begin MSFlexGridLib.MSFlexGrid Grid2
Height = 1365
Left = 180
TabIndex = 3
Top = 270
Width = 9735
_ExtentX = 17171
_ExtentY = 2408
_Version = 393216
Cols = 4
FixedCols = 0
AllowUserResizing= 1
Appearance = 0
End
End
Begin VB.Frame Frame4
Caption = "出差信息"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1755
Left = 90
TabIndex = 0
Top = 6690
Width = 10095
Begin MSFlexGridLib.MSFlexGrid Grid3
Height = 1395
Left = 180
TabIndex = 1
Top = 240
Width = 9735
_ExtentX = 17171
_ExtentY = 2461
_Version = 393216
Cols = 4
FixedCols = 0
AllowUserResizing= 1
Appearance = 0
End
End
End
Attribute VB_Name = "Frm_KQInfoFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim m_LFieldName As String
Dim m_OFieldName As String
Dim m_EFieldName As String
Dim m_AFieldName As String
Private Sub Cmd_OK_Click()
Dim m_Rs As New ADODB.Recordset
Dim strSql As String
Dim i As Integer
'''''''显示上下班信息'''''''''''''''''''''''''''''
If (Combo1.Text = "") And (Text1.Text = "") Then
strSql = "SELECT * FROM AttendanceInfo Order By ID"
Else
strSql = "SELECT * FROM AttendanceInfo WHERE " & Trim(m_AFieldName) & " like '%" & Trim(Text1.Text) & "%'"
End If
''''MsgBox strSql
Set m_Rs = ExecuteSQL(strSql, "Person.mdb")
If m_Rs.RecordCount <> 0 Then
'''''''初始化表格行数''''''''''''
Grid4.Rows = 2
For i = 1 To Grid4.Cols - 1
Grid4.TextMatrix(1, i) = ""
Next
'''''''''''''''''''''''''''''''''''
i = 1
Do While Not m_Rs.EOF
Grid4.Rows = i + 2
Grid4.TextMatrix(i, 0) = m_Rs("AStuffID")
Grid4.TextMatrix(i, 1) = m_Rs("AStuffName")
Grid4.TextMatrix(i, 2) = m_Rs("ADate")
Grid4.TextMatrix(i, 3) = m_Rs("AFlag")
Grid4.TextMatrix(i, 4) = m_Rs("AInTime")
Grid4.TextMatrix(i, 5) = m_Rs("AOutTime")
Grid4.TextMatrix(i, 6) = m_Rs("ALate")
Grid4.TextMatrix(i, 7) = m_Rs("AEarly")
m_Rs.MoveNext
i = i + 1
Loop
End If
'''''''显示请假信息''''''''''''''''''''''''''''''
If (Combo1.Text = "") And (Text1.Text = "") Then
strSql = "SELECT * FROM LeaveInfo Order By LID"
Else
strSql = "SELECT * FROM LeaveInfo WHERE " & Trim(m_LFieldName) & " like '%" & Trim(Text1.Text) & "%'"
End If
''''MsgBox strSql
Set m_Rs = ExecuteSQL(strSql, "Person.mdb")
If m_Rs.RecordCount <> 0 Then
'''''''初始化表格行数''''''''''''
Grid1.Rows = 2
For i = 1 To Grid1.Cols - 1
Grid1.TextMatrix(1, i) = ""
Next
'''''''''''''''''''''''''''''''''''
i = 1
Do While Not m_Rs.EOF
Grid1.Rows = i + 2
Grid1.TextMatrix(i, 0) = m_Rs("LStuffID")
Grid1.TextMatrix(i, 1) = m_Rs("LFromDay")
Grid1.TextMatrix(i, 2) = m_Rs("LIll")
Grid1.TextMatrix(i, 3) = m_Rs("LPrivate")
m_Rs.MoveNext
i = i + 1
Loop
End If
'''''''显示加班信息''''''''''''''''''''''''''''''
If (Combo1.Text = "") And (Text1.Text = "") Then
strSql = "SELECT * FROM OverTimeInfo Order By OID"
Else
strSql = "SELECT * FROM OverTimeInfo WHERE " & Trim(m_OFieldName) & " like '%" & Trim(Text1.Text) & "%'"
End If
''''MsgBox strSql
Set m_Rs = ExecuteSQL(strSql, "Person.mdb")
If m_Rs.RecordCount <> 0 Then
'''''''初始化表格行数''''''''''''
Grid2.Rows = 2
For i = 1 To Grid2.Cols - 1
Grid2.TextMatrix(1, i) = ""
Next
'''''''''''''''''''''''''''''''''''
i = 1
Do While Not m_Rs.EOF
Grid2.Rows = i + 2
Grid2.TextMatrix(i, 0) = m_Rs("OStuffID")
Grid2.TextMatrix(i, 1) = m_Rs("OFromDay")
Grid2.TextMatrix(i, 2) = m_Rs("OSll")
Grid2.TextMatrix(i, 3) = m_Rs("OSpeciality")
m_Rs.MoveNext
i = i + 1
Loop
End If
'''''''显示出差信息''''''''''''''''''''''''''''''
If (Combo1.Text = "") And (Text1.Text = "") Then
strSql = "SELECT * FROM ErrandInfo Order By EID"
Else
strSql = "SELECT * FROM ErrandInfo WHERE " & Trim(m_EFieldName) & " like '%" & Trim(Text1.Text) & "%'"
End If
''''MsgBox strSql
Set m_Rs = ExecuteSQL(strSql, "Person.mdb")
If m_Rs.RecordCount <> 0 Then
'''''''初始化表格行数''''''''''''
Grid3.Rows = 2
For i = 1 To Grid3.Cols - 1
Grid3.TextMatrix(1, i) = ""
Next
'''''''''''''''''''''''''''''''''''
i = 1
Do While Not m_Rs.EOF
Grid3.Rows = i + 2
Grid3.TextMatrix(i, 0) = m_Rs("EStuffID")
Grid3.TextMatrix(i, 1) = m_Rs("EFromDay")
Grid3.TextMatrix(i, 2) = m_Rs("EErrandDays")
Grid3.TextMatrix(i, 3) = m_Rs("EPurpose")
m_Rs.MoveNext
i = i + 1
Loop
End If
End Sub
Private Sub Combo1_Change()
Select Case Trim(Combo1.Text)
Case "职工编号"
m_LFieldName = "LStuffID"
m_OFieldName = "OStuffID"
m_EFieldName = "EStuffID"
m_AFieldName = "AStuffID"
End Select
End Sub
Private Sub Form_Load()
'''''''添加字段名称''''''''''
Combo1.AddItem "职工编号"
''''''添加标题'''''''''''''''''
Grid1.FormatString = " 职工编号 |^ 假期开始日期 |^ 病假天数 |^ 事假天数 "
Grid2.FormatString = " 职工编号 |^ 加班日期 |^ 特殊加班天数 |^ 正常加班天数 "
Grid3.FormatString = " 职工编号 |^ 出差开始日期 |^ 出差天数 |^ 出差目的地 "
Grid4.FormatString = " 职工编号 |^ 职工姓名 |^ 日 期 |^出入标志|^ 上班时间 |^ 下班时间 |^迟到次数|^早退次数"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -