⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmworkrecord.frm

📁 智能门锁的程序,用于控制门锁发卡程序,是科布尔的
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmSrchWorkRecord 
   Caption         =   "工作记录查询"
   ClientHeight    =   6045
   ClientLeft      =   255
   ClientTop       =   330
   ClientWidth     =   9495
   LinkTopic       =   "Form1"
   ScaleHeight     =   6045
   ScaleWidth      =   9495
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   ""
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      Exclusive       =   0   'False
      Height          =   375
      Left            =   5040
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   ""
      Top             =   600
      Visible         =   0   'False
      Width           =   1335
   End
   Begin VB.TextBox TxtCurOperator 
      Height          =   375
      Left            =   8280
      TabIndex        =   18
      Top             =   600
      Width           =   975
   End
   Begin VB.CommandButton CmdCancel 
      Caption         =   "退出"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   8400
      TabIndex        =   17
      Top             =   120
      Width           =   855
   End
   Begin VB.CommandButton CmdAllShow 
      Caption         =   "全部"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   7440
      TabIndex        =   16
      Top             =   120
      Width           =   735
   End
   Begin VB.CommandButton CmdCurDayShow 
      Caption         =   "当天"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   6600
      TabIndex        =   15
      Top             =   120
      Width           =   615
   End
   Begin VB.CommandButton CmdDateShow 
      Caption         =   "按时间显示"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4920
      TabIndex        =   14
      Top             =   120
      Width           =   1455
   End
   Begin VB.PictureBox Picture1 
      BackColor       =   &H00E0E0E0&
      Height          =   375
      Index           =   6
      Left            =   2760
      ScaleHeight     =   315
      ScaleWidth      =   1635
      TabIndex        =   7
      Top             =   240
      Width           =   1695
      Begin VB.TextBox TxtDay 
         BackColor       =   &H00E0E0E0&
         BorderStyle     =   0  'None
         Height          =   255
         Index           =   1
         Left            =   1200
         MaxLength       =   2
         TabIndex        =   10
         Top             =   20
         Width           =   255
      End
      Begin VB.TextBox TxtYear 
         BackColor       =   &H00E0E0E0&
         BorderStyle     =   0  'None
         Height          =   255
         Index           =   1
         Left            =   40
         MaxLength       =   4
         TabIndex        =   9
         Top             =   20
         Width           =   435
      End
      Begin VB.TextBox TxtMonth 
         BackColor       =   &H00E0E0E0&
         BorderStyle     =   0  'None
         Height          =   255
         Index           =   1
         Left            =   720
         MaxLength       =   2
         TabIndex        =   8
         Top             =   20
         Width           =   255
      End
      Begin VB.Label Label1 
         BackColor       =   &H00E0E0E0&
         Caption         =   "月"
         Height          =   375
         Index           =   13
         Left            =   960
         TabIndex        =   13
         Top             =   40
         Width           =   255
      End
      Begin VB.Label Label1 
         BackColor       =   &H00E0E0E0&
         Caption         =   "年"
         Height          =   375
         Index           =   14
         Left            =   480
         TabIndex        =   12
         Top             =   40
         Width           =   255
      End
      Begin VB.Label Label1 
         BackColor       =   &H00E0E0E0&
         Caption         =   "日"
         Height          =   375
         Index           =   15
         Left            =   1440
         TabIndex        =   11
         Top             =   40
         Width           =   255
      End
   End
   Begin VB.PictureBox Picture1 
      BackColor       =   &H00E0E0E0&
      Height          =   375
      Index           =   7
      Left            =   120
      ScaleHeight     =   315
      ScaleWidth      =   1635
      TabIndex        =   0
      Top             =   240
      Width           =   1695
      Begin VB.TextBox TxtMonth 
         BackColor       =   &H00E0E0E0&
         BorderStyle     =   0  'None
         Height          =   255
         Index           =   0
         Left            =   720
         MaxLength       =   2
         TabIndex        =   3
         Top             =   20
         Width           =   255
      End
      Begin VB.TextBox TxtYear 
         BackColor       =   &H00E0E0E0&
         BorderStyle     =   0  'None
         Height          =   255
         Index           =   0
         Left            =   40
         MaxLength       =   4
         TabIndex        =   2
         Top             =   20
         Width           =   435
      End
      Begin VB.TextBox TxtDay 
         BackColor       =   &H00E0E0E0&
         BorderStyle     =   0  'None
         Height          =   255
         Index           =   0
         Left            =   1200
         MaxLength       =   2
         TabIndex        =   1
         Top             =   20
         Width           =   255
      End
      Begin VB.Label Label1 
         BackColor       =   &H00E0E0E0&
         Caption         =   "日"
         Height          =   375
         Index           =   16
         Left            =   1440
         TabIndex        =   6
         Top             =   40
         Width           =   255
      End
      Begin VB.Label Label1 
         BackColor       =   &H00E0E0E0&
         Caption         =   "年"
         Height          =   375
         Index           =   17
         Left            =   480
         TabIndex        =   5
         Top             =   40
         Width           =   255
      End
      Begin VB.Label Label1 
         BackColor       =   &H00E0E0E0&
         Caption         =   "月"
         Height          =   375
         Index           =   18
         Left            =   960
         TabIndex        =   4
         Top             =   40
         Width           =   255
      End
   End
   Begin VB.Label Label3 
      Caption         =   "当班服务员"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   7080
      TabIndex        =   19
      Top             =   600
      Width           =   1095
   End
   Begin VB.Line Line1 
      BorderWidth     =   2
      X1              =   2280
      X2              =   2640
      Y1              =   360
      Y2              =   360
   End
End
Attribute VB_Name = "FrmSrchWorkRecord"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'************************
'*  功能:获得默认的有效日期,时间
'*  作者:韩国栋
'*  时间:2000-2-12
'************************
Sub ValidDate()
    gValidEndDate = Date + 1
    TxtYear(0).Text = Year(Date)
    TxtMonth(0).Text = Right("00" & Month(Date), 2)
    TxtDay(0).Text = Right("00" & Day(Date), 2)
    TxtYear(1).Text = Year(gValidEndDate)
    TxtMonth(1).Text = Right("00" & Month(gValidEndDate), 2)
    TxtDay(1).Text = Right("00" & Day(gValidEndDate), 2)
End Sub
Private Sub CmdAllShow_Click()
    Dim sSQL   As String
    sSQL = "select ICNumber as 卡号,checkinsDate as 发卡时间," & _
        "operatorcheckin as 发卡人,checkoutsdate as 注销时间," & _
        "operatorcheckout as 注销人,shortroomnumber as 房间号  from client"
    Data1.RecordSource = sSQL
    Data1.Refresh
End Sub
Private Sub CmdCancel_Click()
   Unload Me
End Sub
Private Sub CmdCurDayShow_Click()
    Dim sSQL   As String
    Dim sBeginDay, sEndDay As String
    sBeginDay = "" & Year(Date) & "年" & Right("00" & Month(Date), 2) & "月" & Right("00" & Day(Date), 2) & "日" & "00:00:00"
    sEndDay = "" & Year(Date) & "年" & Right("00" & Month(Date), 2) & "月" & Right("00" & Day(Date), 2) & "日" & Time
    sSQL = "select ICNumber as 卡号,checkinsDate as 发卡时间," & _
        "operatorcheckin as 发卡人,checkoutsdate as 注销时间," & _
        "operatorcheckout as 注销人,shortroomnumber as 房间号  from client  where " & _
        " checkinsdate>='" & sBeginDay & "' and checkinsdate<='" & sEndDay & _
        "'  or checkoutsdate>='" & sBeginDay & "' and checkoutsdate<='" & sEndDay & "'"
     Data1.RecordSource = sSQL
    Data1.Refresh
End Sub
Private Sub CmdDateShow_Click()
    Dim sSQL As String
    Dim sBeginDay, sEndDay As String
    If Val(TxtYear(0)) = 0 Or Val(TxtMonth(0)) = 0 Or Val(TxtDay(0).Text) = 0 _
        Or Val(TxtYear(1)) = 0 Or Val(TxtMonth(1)) = 0 Or Val(TxtDay(1).Text) = 0 Then
        MsgBox "日期范围错误!", vbInformation + vbOKOnly, "提示"
        Exit Sub
    End If
    sBeginDay = TxtYear(0).Text & "年" & Right("00" & TxtMonth(0).Text, 2) & "月" & Right(TxtDay(0).Text, 2) & "日" & "00:00:00"
    sEndDay = TxtYear(1).Text & "年" & Right("00" & TxtMonth(1).Text, 2) & "月" & Right("00" & TxtDay(1).Text, 2) & "日" & gCheckOutTime
    sSQL = "select ICNumber as 卡号,checkinsDate as 发卡时间," & _
        "operatorcheckin as 发卡人,checkoutsdate as 注销时间," & _
        "operatorcheckout as 注销人,shortroomnumber as 房间号  from client  where " & _
        " checkinsdate>='" & sBeginDay & "' and checkinsdate<='" & sEndDay & _
        "'  or checkoutsdate>='" & sBeginDay & "' and checkoutsdate<='" & sEndDay & "'"
    Data1.RecordSource = sSQL
    Data1.Refresh
End Sub



Private Sub Form_Load()
    Data1.DatabaseName = SystemDir & "icdata.mdb"
    TxtCurOperator.Text = gUserName
    ValidDate
End Sub

Private Sub TxtYear_Change(Index As Integer)
    Dim sTmp As String
    sTmp = TxtYear(Index).Text
    sTmp = "0000" & sTmp
    If Mid(sTmp, Len(sTmp), 1) < "0" Or Mid(sTmp, Len(sTmp), 1) > "9" _
           Or Mid(sTmp, Len(sTmp) - 1, 1) < "0" Or Mid(sTmp, Len(sTmp) - 1, 1) > "9" _
           Or Mid(sTmp, Len(sTmp) - 2, 1) < "0" Or Mid(sTmp, Len(sTmp) - 2, 1) > "9" _
           Or Mid(sTmp, Len(sTmp) - 3, 1) < "0" Or Mid(sTmp, Len(sTmp) - 3, 1) > "9" _
            Then
       MsgBox "日期年(2000以上数字)!", vbInformation + vbOKOnly, "提示"
       TxtYear(Index).Text = Left(TxtYear(Index).Text, Len(TxtYear(Index).Text) - 1)
    End If
End Sub
Private Sub TxtYear_LostFocus(Index As Integer)
    If Val(TxtYear(Index).Text) < 2000 Then
       TxtYear(Index).Text = "2000"
       MsgBox "日期年(2000以上数字)!", vbInformation + vbOKOnly, "提示"
    End If
End Sub
Private Sub TxtMonth_Change(Index As Integer)
    Dim sTmp As String
    sTmp = TxtMonth(Index).Text
    sTmp = "00" & sTmp
    If Mid(sTmp, Len(sTmp), 1) < "0" Or Mid(sTmp, Len(sTmp), 1) > "9" _
           Or Mid(sTmp, Len(sTmp) - 1, 1) < "0" Or Mid(sTmp, Len(sTmp) - 1, 1) _
           > "9" Or Val(sTmp) > 12 Then
       MsgBox "日期月(00~12)输入错误!", vbInformation + vbOKOnly, "提示"
       TxtMonth(Index).Text = Left(TxtMonth(Index).Text, Len(TxtMonth(Index).Text) - 1)
    End If
End Sub
Private Sub TxtMonth_LostFocus(Index As Integer)
    TxtMonth(Index).Text = Right("00" & Val(TxtMonth(Index).Text), 2)
End Sub
Private Sub TxtDay_Change(Index As Integer)
    Dim sTmp As String
    sTmp = TxtDay(Index).Text
    sTmp = "00" & sTmp
    If Mid(sTmp, Len(sTmp), 1) < "0" Or Mid(sTmp, Len(sTmp), 1) > "9" _
           Or Mid(sTmp, Len(sTmp) - 1, 1) < "0" Or Mid(sTmp, Len(sTmp) - 1, 1) _
           > "9" Or Val(sTmp) > 31 Then
       MsgBox "日期(日00~31)输入错误!", vbInformation + vbOKOnly, "提示"
       TxtDay(Index).Text = Left(TxtDay(Index).Text, Len(TxtDay(Index).Text) - 1)
    End If
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -