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

交通/航空行业

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form frmStatistic2 
  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           =   255
  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           =   255
  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 = "frmStatistic2"
  90. Attribute VB_GlobalNameSpace = False
  91. Attribute VB_Creatable = False
  92. Attribute VB_PredeclaredId = True
  93. Attribute VB_Exposed = False
  94. Option Explicit
  95. Public sQSql As String
  96. Private Sub cmdExit_Click()
  97.     Me.Hide
  98. End Sub
  99. Private Sub cmdOK_Click()
  100.     Dim txtSQL As String
  101.     
  102.     If chkItem(0).Value = vbChecked Then
  103.         sQSql = " yyid ='" & Trim(txtItem(0) & " ") & "'"
  104.     End If
  105.     
  106.     If chkItem(1).Value = vbChecked Then
  107.         If Trim(sQSql & " ") = "" Then
  108.             sQSql = " yydriver ='" & Trim(txtItem(1) & " ") & "'"
  109.         Else
  110.             sQSql = sQSql & " and yydriver ='" & Trim(txtItem(1) & " ") & "'"
  111.         End If
  112.     End If
  113.     
  114.     If Trim(sQSql) = "" Then
  115.         MsgBox "请设置查询方式!", vbOKOnly + vbExclamation, "警告"
  116.         Exit Sub
  117.     Else
  118.         If flagsEdit Then
  119.             Unload frmStatistic
  120.         End If
  121.         frmStatistic.txtSQL = "select * from statistic where " & sQSql
  122.         frmStatistic.Show
  123.     End If
  124.     
  125.     Me.Hide
  126. End Sub
  127. Private Sub lblitem_Click(Index As Integer)
  128.     chkItem(Index).Value = vbChecked
  129.     txtItem(Index).SetFocus
  130. End Sub
  131. Private Sub chkItem_Click(Index As Integer)
  132.     txtItem(Index).SetFocus
  133. End Sub
  134. Private Sub txtItem_GotFocus(Index As Integer)
  135.     
  136.     txtItem(Index).SelStart = 0
  137.     txtItem(Index).SelLength = Len(txtItem(Index))
  138. End Sub