📄 form13.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form Form11
Caption = "考勤信息列表"
ClientHeight = 8775
ClientLeft = 60
ClientTop = 345
ClientWidth = 8775
Icon = "Form13.frx":0000
LinkTopic = "Form11"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 8775
ScaleWidth = 8775
StartUpPosition = 2 '屏幕中心
Begin MSFlexGridLib.MSFlexGrid recordlist
Height = 5175
Left = 600
TabIndex = 1
Top = 2160
Width = 7095
_ExtentX = 12515
_ExtentY = 9128
_Version = 393216
Cols = 9
BackColor = 8421376
End
Begin VB.Image Image1
Height = 1575
Index = 1
Left = 6600
Picture = "Form13.frx":08CA
Top = 0
Width = 2085
End
Begin VB.Image Image2
Height = 420
Left = 2040
Picture = "Form13.frx":1D71
Top = 1320
Width = 3000
End
Begin VB.Image Image1
Height = 225
Index = 0
Left = 6000
Picture = "Form13.frx":3DBC
Top = -360
Width = 225
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
BorderStyle = 1 'Fixed Single
Caption = " 员工考勤信息"
BeginProperty Font
Name = "隶书"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FF00&
Height = 585
Left = 1560
TabIndex = 0
Top = 240
Width = 3960
End
End
Attribute VB_Name = "Form11"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Sub ListTopic()
Dim i As Integer
With Me.recordlist '设置表头
.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) = "早退次数"
For i = 0 To 8 '设置所有表格对齐方式
.ColAlignment(i) = 4
Next i
For i = 0 To 8 '设置每列宽度
.ColWidth(i) = 1500
Next i
End With
End Sub
Public Sub ShowData(query As String)
Dim rsAttendance As New ADODB.Recordset
Set rsAttendance = TransactSQL(query)
If rsAttendance.EOF = False Then
With Me.recordlist
.Rows = 1
While Not rsAttendance.EOF
.Rows = .Rows + 1
.TextMatrix(.Rows - 1, 0) = rsAttendance(0)
.TextMatrix(.Rows - 1, 1) = rsAttendance(1)
.TextMatrix(.Rows - 1, 2) = rsAttendance(2)
.TextMatrix(.Rows - 1, 3) = rsAttendance(3)
.TextMatrix(.Rows - 1, 4) = rsAttendance(4)
If IsNull(rsAttendance(5)) Then
.TextMatrix(.Rows - 1, 5) = ""
Else
.TextMatrix(.Rows - 1, 5) = rsAttendance(5)
End If
If IsNull(rsAttendance(6)) Then
.TextMatrix(.Rows - 1, 6) = ""
Else
.TextMatrix(.Rows - 1, 6) = rsAttendance(6)
End If
.TextMatrix(.Rows - 1, 7) = rsAttendance(7)
.TextMatrix(.Rows - 1, 8) = rsAttendance(8)
rsAttendance.MoveNext
Wend
rsAttendance.Close
End With
End If
End Sub
Private Sub Form_Load()
Dim sql As String
sql = "select * from test order by ID desc"
Call ListTopic
Call ShowData(sql)
End Sub
Private Sub recordlist_DblClick()
flag = 2
If Form11.recordlist.Rows > 1 Then
kqsql = "select * from test where ID=" & Trim( _
Form11.recordlist.TextMatrix(Form11.recordlist.Row, 0))
Form8.Show
Form8.ZOrder 0
ArecordID = Trim(Form11.recordlist.TextMatrix(Form11.recordlist.Row, 0))
Else
MsgBox "没有考勤信息!", vbOKOnly + vbExclamation, "警告!"
flag = 1
Form8.Show
End If
End Sub
Private Sub recordlist_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 And Shift = 0 Then
PopupMenu popmenu.popmenu1
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -