frmDriver2.frm
上传用户:lizhip88
上传日期:2007-06-21
资源大小:42k
文件大小:4k
源码类别:

交通/航空行业

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form frmDriver2 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "司机信息查询"
  5.    ClientHeight    =   1776
  6.    ClientLeft      =   48
  7.    ClientTop       =   336
  8.    ClientWidth     =   4680
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   1776
  13.    ScaleWidth      =   4680
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   1  'CenterOwner
  16.    Begin VB.CheckBox chkItem 
  17.       Caption         =   "Check1"
  18.       Height          =   180
  19.       Index           =   1
  20.       Left            =   240
  21.       TabIndex        =   7
  22.       TabStop         =   0   'False
  23.       Top             =   720
  24.       Width           =   132
  25.    End
  26.    Begin VB.CheckBox chkItem 
  27.       Caption         =   "Check1"
  28.       Height          =   180
  29.       Index           =   0
  30.       Left            =   240
  31.       TabIndex        =   6
  32.       TabStop         =   0   'False
  33.       Top             =   240
  34.       Value           =   1  'Checked
  35.       Width           =   132
  36.    End
  37.    Begin VB.CommandButton cmdOk 
  38.       Caption         =   "确定 (&O)"
  39.       Default         =   -1  'True
  40.       Height          =   375
  41.       Left            =   840
  42.       TabIndex        =   2
  43.       Top             =   1320
  44.       Width           =   1215
  45.    End
  46.    Begin VB.CommandButton cmdExit 
  47.       Caption         =   "取消 (&X)"
  48.       Height          =   375
  49.       Left            =   2760
  50.       TabIndex        =   3
  51.       Top             =   1320
  52.       Width           =   1215
  53.    End
  54.    Begin VB.TextBox txtItem 
  55.       Height          =   270
  56.       Index           =   1
  57.       Left            =   1680
  58.       TabIndex        =   1
  59.       Top             =   720
  60.       Width           =   2655
  61.    End
  62.    Begin VB.TextBox txtItem 
  63.       Height          =   270
  64.       Index           =   0
  65.       Left            =   1680
  66.       TabIndex        =   0
  67.       Top             =   240
  68.       Width           =   2655
  69.    End
  70.    Begin VB.Label lblitem 
  71.       Caption         =   "准驾车型:"
  72.       Height          =   255
  73.       Index           =   1
  74.       Left            =   600
  75.       TabIndex        =   5
  76.       Top             =   720
  77.       Width           =   1095
  78.    End
  79.    Begin VB.Label lblitem 
  80.       Caption         =   "姓        名:"
  81.       Height          =   255
  82.       Index           =   0
  83.       Left            =   600
  84.       TabIndex        =   4
  85.       Top             =   240
  86.       Width           =   1095
  87.    End
  88. End
  89. Attribute VB_Name = "frmDriver2"
  90. Attribute VB_GlobalNameSpace = False
  91. Attribute VB_Creatable = False
  92. Attribute VB_PredeclaredId = True
  93. Attribute VB_Exposed = False
  94. Option Explicit
  95. Private Sub cmdExit_Click()
  96.     Me.Hide
  97. End Sub
  98. Private Sub cmdOK_Click()
  99.     Dim txtSQL As String
  100.     
  101.     If chkItem(0).Value = vbChecked Then
  102.         txtSQL = " sjname ='" & Trim(txtItem(0) & " ") & "'"
  103.     End If
  104.     
  105.     If chkItem(1).Value = vbChecked Then
  106.         If Trim(txtSQL & " ") = "" Then
  107.             txtSQL = " sjtype ='" & Trim(txtItem(1) & " ") & "'"
  108.         Else
  109.             txtSQL = txtSQL & " and sjtype ='" & Trim(txtItem(1) & " ") & "'"
  110.         End If
  111.     End If
  112.     
  113.     Me.Hide
  114.     If Trim(txtSQL) = "" Then
  115.         MsgBox "请设置查询方式!", vbOKOnly + vbExclamation, "警告"
  116.         Exit Sub
  117.     Else
  118.         If flagdEdit Then
  119.             Unload frmDriver
  120.         End If
  121.         frmDriver.txtSQL = "select * from driver where" & txtSQL
  122.         frmDriver.Show
  123.     End If
  124. End Sub
  125. Private Sub lblitem_Click(Index As Integer)
  126.     chkItem(Index).Value = vbChecked
  127.     txtItem(Index).SetFocus
  128. End Sub
  129. Private Sub chkItem_Click(Index As Integer)
  130.     txtItem(Index).SetFocus
  131. End Sub
  132. Private Sub txtItem_GotFocus(Index As Integer)
  133.     
  134.     txtItem(Index).SelStart = 0
  135.     txtItem(Index).SelLength = Len(txtItem(Index))
  136. End Sub