?? frmvehiclefind.frm
字號(hào):
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 = "華文細(xì)黑"
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 = "華文細(xì)黑"
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 "請(qǐng)選擇查詢關(guān)鍵字", vbOKOnly + vbExclamation, "警告"
Else
'Select Case cobs.Index
'Case 0
If Trim(cobs.Text) = "牌照" Then
If Trim(txts.Text) = "" Then
MsgBox "請(qǐng)輸入要查詢的車牌號(hào)", 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 "請(qǐng)輸入要查詢的車型", 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 "請(qǐng)輸入要查詢的車主", vbOKOnly + vbExclamation, "警告"
txts.SetFocus
Else
txtsql = "cl_owner='" & Trim(txts.Text) & "'"
End If
End If
If Trim(cobs.Text) = "發(fā)動(dòng)機(jī)號(hào)" Then
If Trim(txts.Text) = "" Then
MsgBox "請(qǐng)輸入要查詢的發(fā)動(dòng)機(jī)號(hào)", vbOKOnly + vbExclamation, "警告"
txts.SetFocus
Else
txtsql = "cl_code1='" & Trim(txts.Text) & "'"
End If
End If
If Trim(cobs.Text) = "車架號(hào)" Then
If Trim(txts.Text) = "" Then
MsgBox "請(qǐng)輸入要查詢的車架號(hào)", vbOKOnly + vbExclamation, "警告"
txts.SetFocus
Else
txtsql = "cl_code2='" & Trim(txts.Text) & "'"
End If
End If
If Trim(cobs.Text) = "廠家型號(hào)" Then
If Trim(txts.Text) = "" Then
MsgBox "請(qǐng)輸入要查詢的廠家型號(hào)", 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 "請(qǐng)輸入要查詢的載客數(shù)", vbOKOnly + vbExclamation, "警告"
txts.SetFocus
If Not IsNumeric(Trim(txts.Text)) Then
MsgBox "您輸入的不是數(shù)據(jù),請(qǐng)重新輸入!", 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 "請(qǐng)輸入要查詢的車輛顏色", vbOKOnly + vbExclamation, "警告"
txts.SetFocus
Else
txtsql = "cl_color='" & Trim(txts.Text) & "'"
End If
End If
'End Select
End If
If Trim(txtsql) = "" Then
MsgBox "請(qǐng)?jiān)O(shè)置查詢方式", 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 "發(fā)動(dòng)機(jī)號(hào)", 3
cobs.AddItem "車架號(hào)", 4
cobs.AddItem "廠家型號(hào)", 5
cobs.AddItem "核定載客", 6
cobs.AddItem "顏色", 7
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -