📄 frm_queticketinfo.frm
字号:
VERSION 5.00
Begin VB.Form frm_queticketinfo
Caption = "查询购票信息"
ClientHeight = 1950
ClientLeft = 60
ClientTop = 450
ClientWidth = 7725
LinkTopic = "Form1"
ScaleHeight = 1950
ScaleWidth = 7725
StartUpPosition = 3 '窗口缺省
Begin VB.ComboBox cmbacity
Height = 315
Left = 5160
TabIndex = 7
Text = "请选择"
Top = 360
Width = 1815
End
Begin VB.ComboBox cmbttime
Height = 315
Left = 5160
TabIndex = 6
Text = "请选择"
Top = 840
Width = 1815
End
Begin VB.CommandButton fault
Caption = "取消"
Height = 375
Left = 4800
TabIndex = 5
Top = 1320
Width = 975
End
Begin VB.CommandButton Cmd_que
Caption = "查询"
Height = 375
Left = 2760
TabIndex = 4
Top = 1320
Width = 975
End
Begin VB.ComboBox cmbtdate
Height = 315
Left = 1800
TabIndex = 3
Text = "请选择"
Top = 840
Width = 1815
End
Begin VB.ComboBox cmbdcity
Height = 315
Left = 1800
TabIndex = 1
Text = "请选择"
Top = 360
Width = 1815
End
Begin VB.Label Label4
Caption = "到达城市"
Height = 255
Left = 4080
TabIndex = 9
Top = 360
Width = 735
End
Begin VB.Label Label3
Caption = "车票时间"
Height = 255
Left = 4080
TabIndex = 8
Top = 840
Width = 735
End
Begin VB.Label Label2
Caption = "车票日期"
Height = 255
Left = 720
TabIndex = 2
Top = 840
Width = 735
End
Begin VB.Label Label1
Caption = "起始城市"
Height = 255
Left = 720
TabIndex = 0
Top = 360
Width = 735
End
End
Attribute VB_Name = "frm_queticketinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmd_que_Click()
Dim strSQL As String
strSQL = "Select * from ticketinfo where 1=1"
If cmbdcity.ListIndex > 0 Then
strSQL = strSQL + " and departcity='" + cmbdcity.Text + "'"
End If
If cmbacity.ListIndex > 0 Then
strSQL = strSQL + " and arrivalcity='" + cmbacity.Text + "'"
End If
If cmbtdate.ListIndex > 0 Then
strSQL = strSQL + " and ticketdate='" + cmbtdate.Text + "'"
End If
If cmbttime.ListIndex > 0 Then
strSQL = strSQL + " and tickettime='" + cmbttime.Text + "'"
End If
frm_ticket.FGridDatatable.Clear
frm_ticket.ShowTitle
frm_ticket.loadData (strSQL)
frm_ticket.Show
Unload Me
End Sub
Private Sub Form_Load()
Dim strSQL As String
Dim i As Integer
OpenDB
strSQL = "Select Distinct departcity from ticketinfo"
objRS.Open strSQL, objConn, adOpenKeyset, adLockPessimistic
If Not objRS.EOF Then
Do While Not objRS.EOF
cmbdcity.AddItem objRS.Fields(0).Value
objRS.MoveNext
Loop
objRS.Close
Else
objRS.Close
CloseDB
MsgBox "请先设置车票信息", vbOKOnly
Exit Sub
End If
strSQL = "Select Distinct arrivalcity from ticketinfo"
objRS.Open strSQL, objConn, 1, 3
Do While Not objRS.EOF
cmbacity.AddItem objRS.Fields(0).Value
objRS.MoveNext
Loop
objRS.Close
strSQL = "Select Distinct ticketdate from ticketinfo"
objRS.Open strSQL, objConn, 1, 3
Do While Not objRS.EOF
cmbtdate.AddItem objRS.Fields(0).Value
objRS.MoveNext
Loop
objRS.Close
strSQL = "Select Distinct tickettime from ticketinfo"
objRS.Open strSQL, objConn, 1, 3
Do While Not objRS.EOF
cmbttime.AddItem objRS.Fields(0).Value
objRS.MoveNext
Loop
objRS.Close
CloseDB
End Sub
Private Sub fault_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -