📄 frmvehiclefind.frm
字号:
VERSION 5.00
Begin VB.Form frmvehiclefind
BorderStyle = 1 'Fixed Single
Caption = "查询"
ClientHeight = 2595
ClientLeft = 4020
ClientTop = 1650
ClientWidth = 6900
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 2595
ScaleWidth = 6900
Begin VB.Frame Frame1
Caption = "车辆信息查询"
Height = 2175
Left = 120
TabIndex = 0
Top = 240
Width = 6615
Begin VB.TextBox txts
Height = 375
Left = 3960
TabIndex = 6
Top = 480
Width = 2295
End
Begin VB.CommandButton cmdcancel
Caption = "取 消"
Height = 375
Left = 4200
TabIndex = 4
Top = 1440
Width = 1215
End
Begin VB.CommandButton cmdok
Caption = "查 询"
Height = 375
Left = 2520
TabIndex = 3
Top = 1440
Width = 1095
End
Begin VB.ComboBox cobs
Height = 300
ItemData = "frmvehiclefind.frx":0000
Left = 720
List = "frmvehiclefind.frx":0002
TabIndex = 2
Top = 480
Width = 2175
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "查询:"
BeginProperty Font
Name = "华文细黑"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2880
TabIndex = 5
Top = 480
Width = 975
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "按"
BeginProperty Font
Name = "华文细黑"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 1
Top = 480
Width = 495
End
End
End
Attribute VB_Name = "frmvehiclefind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdcancel_Click()
Unload Me
End Sub
Private Sub cmdok_Click()
Dim txtsql As String
If Trim(cobs.Text) = "" Then
MsgBox "请选择查询关键字", vbOKOnly + vbExclamation, "警告"
Else
'Select Case cobs.Index
'Case 0
If Trim(cobs.Text) = "牌照" Then
If Trim(txts.Text) = "" Then
MsgBox "请输入要查询的车牌号", vbOKOnly + vbExclamation, "警告"
'Exit Sub
txts.SetFocus
Else
txtsql = "cl_id='" & Trim(txts.Text) & "'"
End If
End If
If Trim(cobs.Text) = "车型" Then
If Trim(txts.Text) = "" Then
MsgBox "请输入要查询的车型", vbOKOnly + vbExclamation, "警告"
txts.SetFocus
Else
txtsql = "cl_kind='" & Trim(txts.Text) & "'"
End If
End If
If Trim(cobs.Text) = "车主" Then
If Trim(txts.Text) = "" Then
MsgBox "请输入要查询的车主", vbOKOnly + vbExclamation, "警告"
txts.SetFocus
Else
txtsql = "cl_owner='" & Trim(txts.Text) & "'"
End If
End If
If Trim(cobs.Text) = "发动机号" Then
If Trim(txts.Text) = "" Then
MsgBox "请输入要查询的发动机号", vbOKOnly + vbExclamation, "警告"
txts.SetFocus
Else
txtsql = "cl_code1='" & Trim(txts.Text) & "'"
End If
End If
If Trim(cobs.Text) = "车架号" Then
If Trim(txts.Text) = "" Then
MsgBox "请输入要查询的车架号", vbOKOnly + vbExclamation, "警告"
txts.SetFocus
Else
txtsql = "cl_code2='" & Trim(txts.Text) & "'"
End If
End If
If Trim(cobs.Text) = "厂家型号" Then
If Trim(txts.Text) = "" Then
MsgBox "请输入要查询的厂家型号", vbOKOnly + vbExclamation, "警告"
txts.SetFocus
Else
txtsql = "cl_code3='" & Trim(txts.Text) & "'"
End If
End If
If Trim(cobs.Text) = "核定载客" Then
If Trim(txts.Text) = "" Then
MsgBox "请输入要查询的载客数", vbOKOnly + vbExclamation, "警告"
txts.SetFocus
If Not IsNumeric(Trim(txts.Text)) Then
MsgBox "您输入的不是数据,请重新输入!", vbOKOnly + vbExclamation, "警告"
Else
txtsql = "cl_passenger='" & Trim(txts.Text) & "'"
End If
End If
End If
If Trim(cobs.Text) = "颜色" Then
If Trim(txts.Text) = "" Then
MsgBox "请输入要查询的车辆颜色", vbOKOnly + vbExclamation, "警告"
txts.SetFocus
Else
txtsql = "cl_color='" & Trim(txts.Text) & "'"
End If
End If
'End Select
End If
If Trim(txtsql) = "" Then
MsgBox "请设置查询方式", vbOKOnly + vbExclamation, "警告"
Exit Sub
Else
Unload Me
frmvehiclelist.txtsql = "select * from vehicle where " & txtsql
frmvehiclelist.Show
End If
End Sub
Private Sub Form_Load()
Me.Left = 3975
Me.Top = 1320
cobs.AddItem "牌照", 0
cobs.AddItem "车型", 1
cobs.AddItem "车主", 2
cobs.AddItem "发动机号", 3
cobs.AddItem "车架号", 4
cobs.AddItem "厂家型号", 5
cobs.AddItem "核定载客", 6
cobs.AddItem "颜色", 7
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -