📄 frmdaydata.frm
字号:
VERSION 5.00
Begin VB.Form frmDayData
BorderStyle = 1 'Fixed Single
Caption = "日考勤"
ClientHeight = 3195
ClientLeft = 45
ClientTop = 330
ClientWidth = 5265
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 5265
Begin VB.ListBox List1
Height = 2040
Left = 240
TabIndex = 2
Top = 840
Width = 4815
End
Begin VB.TextBox txtId
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 2160
MaxLength = 6
TabIndex = 1
Top = 240
Width = 1455
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "员工工号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Left = 840
TabIndex = 0
Top = 360
Width = 1020
End
End
Attribute VB_Name = "frmDayData"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public mrc As ADODB.Recordset
Dim txtSql As String
Private Sub Form_Load()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
End Sub
Private Sub txtId_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtSql = "select * from dayData where Id ='" & txtId.Text & "' and BrushDate='" & Date & "' and BrushTime='" & Format(Time, "hh:mm:ss") & "'"
Set mrc = Nothing
Set mrc = ExecuteSQL(txtSql)
If mrc.EOF = True Then
txtSql = "select * from dayData"
Set mrc = Nothing
Set mrc = ExecuteSQL(txtSql)
mrc.AddNew
mrc.Fields(0) = txtId.Text
mrc.Fields(1) = Date
mrc.Fields(2) = Format(Time, "hh:mm:ss")
List1.AddItem "工号: " & txtId.Text & " 刷卡时间:" & mrc.Fields(1) & " " & mrc.Fields(2)
mrc.Update
txtId.Text = ""
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -