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

📄 frmdrivercha.frm

📁 车辆管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmDrivercha 
   Caption         =   "驾驶员档案查询"
   ClientHeight    =   4035
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7695
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   4035
   ScaleWidth      =   7695
   Begin VB.Frame Frame2 
      Caption         =   "Frame2"
      Height          =   2265
      Left            =   45
      TabIndex        =   16
      Top             =   1680
      Width           =   7560
      Begin MSAdodcLib.Adodc Adodc1 
         Height          =   735
         Left            =   3585
         Top             =   960
         Visible         =   0   'False
         Width           =   2295
         _ExtentX        =   4048
         _ExtentY        =   1296
         ConnectMode     =   0
         CursorLocation  =   3
         IsolationLevel  =   -1
         ConnectionTimeout=   15
         CommandTimeout  =   30
         CursorType      =   3
         LockType        =   3
         CommandType     =   1
         CursorOptions   =   0
         CacheSize       =   50
         MaxRecords      =   0
         BOFAction       =   0
         EOFAction       =   0
         ConnectStringType=   1
         Appearance      =   1
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Orientation     =   0
         Enabled         =   -1
         Connect         =   ""
         OLEDBString     =   ""
         OLEDBFile       =   ""
         DataSourceName  =   ""
         OtherAttributes =   ""
         UserName        =   ""
         Password        =   ""
         RecordSource    =   ""
         Caption         =   "Adodc1"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         _Version        =   393216
      End
      Begin MSDataGridLib.DataGrid DataGrid1 
         Bindings        =   "frmDrivercha.frx":0000
         Height          =   1935
         Left            =   105
         TabIndex        =   17
         Top             =   210
         Width           =   7320
         _ExtentX        =   12912
         _ExtentY        =   3413
         _Version        =   393216
         AllowUpdate     =   0   'False
         HeadLines       =   1
         RowHeight       =   15
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   2
         BeginProperty Column00 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "查询条件"
      ForeColor       =   &H00FF0000&
      Height          =   1470
      Left            =   45
      TabIndex        =   0
      Top             =   105
      Width           =   7545
      Begin VB.CommandButton cmdExit 
         Caption         =   "退 出(&E)"
         Height          =   360
         Left            =   6375
         TabIndex        =   15
         Top             =   1035
         Width           =   990
      End
      Begin VB.CommandButton cmdOk 
         Caption         =   "查 询(&F)"
         Height          =   360
         Left            =   6375
         TabIndex        =   14
         Top             =   255
         Width           =   990
      End
      Begin VB.TextBox txtJL 
         Enabled         =   0   'False
         Height          =   300
         Left            =   4785
         TabIndex        =   13
         Top             =   255
         Width           =   1335
      End
      Begin MSComCtl2.DTPicker dtYX 
         Height          =   300
         Left            =   4785
         TabIndex        =   12
         Top             =   630
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   529
         _Version        =   393216
         Enabled         =   0   'False
         Format          =   66256897
         CurrentDate     =   38056
      End
      Begin MSComCtl2.DTPicker dtEnd 
         Height          =   300
         Left            =   3465
         TabIndex        =   11
         Top             =   1005
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   529
         _Version        =   393216
         Enabled         =   0   'False
         Format          =   66256897
         CurrentDate     =   38056
      End
      Begin MSComCtl2.DTPicker dtStart 
         Height          =   300
         Left            =   1740
         TabIndex        =   10
         Top             =   1005
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   529
         _Version        =   393216
         Enabled         =   0   'False
         Format          =   66256897
         CurrentDate     =   38056
      End
      Begin VB.TextBox txtName 
         Enabled         =   0   'False
         Height          =   300
         Left            =   1740
         TabIndex        =   7
         Top             =   255
         Width           =   1335
      End
      Begin VB.ComboBox cmSex 
         Enabled         =   0   'False
         Height          =   300
         ItemData        =   "frmDrivercha.frx":0015
         Left            =   1740
         List            =   "frmDrivercha.frx":001F
         TabIndex        =   6
         Top             =   630
         Width           =   1335
      End
      Begin VB.CheckBox ckName 
         Caption         =   "姓  名:"
         Height          =   255
         Left            =   195
         TabIndex        =   5
         Top             =   255
         Width           =   1215
      End
      Begin VB.CheckBox ckYX 
         Caption         =   "证件有效期:"
         Height          =   255
         Left            =   3465
         TabIndex        =   4
         Top             =   630
         Width           =   1575
      End
      Begin VB.CheckBox ckBorn 
         Caption         =   "出生年月:"
         Height          =   255
         Left            =   165
         TabIndex        =   3
         Top             =   1005
         Width           =   1215
      End
      Begin VB.CheckBox ckJL 
         Caption         =   "驾龄:"
         Height          =   180
         Left            =   3465
         TabIndex        =   2
         Top             =   255
         Width           =   855
      End
      Begin VB.CheckBox ckSex 
         Caption         =   "性别:"
         Height          =   180
         Left            =   195
         TabIndex        =   1
         Top             =   667
         Width           =   855
      End
      Begin VB.Label Label3 
         Caption         =   "到"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   3150
         TabIndex        =   9
         Top             =   1095
         Width           =   255
      End
      Begin VB.Label Label2 
         Caption         =   "从"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   1485
         TabIndex        =   8
         Top             =   1095
         Width           =   255
      End
   End
End
Attribute VB_Name = "frmDrivercha"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub ckBorn_Click()
    If ckBorn.Value Then
        dtStart.Enabled = True
        dtEnd.Enabled = True
    Else
        dtStart.Enabled = False
        dtEnd.Enabled = False
    End If
End Sub

Private Sub ckJL_Click()
    If ckJL.Value Then
        txtJL.Enabled = True
    Else
        txtJL.Enabled = False
    End If
    
End Sub

Private Sub ckName_Click()
    If ckName.Value Then
        txtName.Enabled = True
    Else
        txtName.Enabled = False
    End If
End Sub

Private Sub ckSex_Click()
    If ckSex.Value Then
        cmSex.Enabled = True
    Else
        cmSex.Enabled = False
    End If
End Sub

Private Sub ckYX_Click()
    If ckYX.Value Then
        dtYX.Enabled = True
    Else
        dtYX.Enabled = False
    End If
End Sub

Private Sub cmdExit_Click()
MDIForm1.StatusBar1.Panels(1).Text = ""
    Unload Me
End Sub


Private Sub cmdOk_Click()
    '点击查询按纽后首先清空驾驶员档案列表
    Call QingKong
    Dim sql As String
    Dim sname As String
    If ckName.Value Then
        sname = "姓名 like '" & txtName & "%'"
    Else
        sname = "姓名 like '%'"
    End If

    Dim ssex As String
    If ckSex.Value Then
        ssex = "性别 ='" & cmSex.Text & "'"
        Else
        ssex = "性别 like '%'"
    End If
    Dim sborn As String
    If ckBorn.Value Then
        sborn = "出生年月 between #" & dtStart.Month & "/" & dtStart.Day & "/" & dtStart.Year & "# and #" & dtEnd.Month & "/" & dtEnd.Day & "/" & dtEnd.Year & "#"
        Else
        sborn = "出生年月 like '%'"
    End If

    Dim sjl As String
    If ckJL.Value Then
        sjl = "驾龄>=" & txtJL & ""
        Else
        sjl = "驾龄 like '%'"
    End If

    Dim syx As String
    If ckYX.Value Then
       syx = "证件有效期 =#" & dtYX.Month & "/" & dtYX.Day & "/" & dtYX.Year & "#"
       Else
        syx = "证件有效期 like '%'"
    End If
    sql = "select * from 驾驶员档案 where " & sname & "and " & ssex & "and " & sborn & "and " & sjl & "and " & syx
    If sql = "select * from 驾驶员档案 where 姓名 like '%'and 性别 like '%'and 出生年月 like '%'and 驾龄 like '%'and 证件有效期 like '%'" Then
        '清空上一次的查询记录
        Call QingKong
        MsgBox "请选择查询条件", , "系统提示"
        Exit Sub
    End If
    Set adors = adoCon.Execute(sql)
    If adors.EOF Then
        Call QingKong
        MsgBox "对不起,没有符合您查询的条件!", , "系统提示"
    Else
       Adodc1.RecordSource = sql
       Adodc1.Refresh
    End If
    adors.Close
    ckName.Value = 0
    ckSex.Value = 0
    ckBorn.Value = 0
    ckYX.Value = 0
    ckJL.Value = 0
End Sub
Private Sub Form_Load()
    frmDrivercha.Width = 7815
    frmDrivercha.Height = 4440
    cmSex.ListIndex = 0
    Call Rebind
End Sub

Private Sub Rebind()
    Frame2.Caption = "驾驶员档案列表"
    Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\clgl.mdb;Persist Security Info=False"
    Adodc1.RecordSource = "select * from 驾驶员档案"
    Adodc1.Refresh
End Sub
Private Sub QingKong()
    Frame2.Caption = "您所要查询的驾驶员档案如下:"
    Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\clgl.mdb;Persist Security Info=False"
    Adodc1.RecordSource = "select * from 驾驶员档案 where 0=1"
    Adodc1.Refresh
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    cmdExit_Click
End Sub

⌨️ 快捷键说明

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