📄 销售车票.frm
字号:
Width = 495
End
Begin MSAdodcLib.Adodc Adodc2
Height = 375
Left = 1920
Top = 4680
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = $"销售车票.frx":08CD
OLEDBString = $"销售车票.frx":0956
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "站名"
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
ItemData = "销售车票.frx":09DF
Left = 7920
List = "销售车票.frx":09E1
TabIndex = 1
Top = 840
Width = 1815
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 600
Top = 4680
Visible = 0 'False
Width = 1215
_ExtentX = 2143
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = $"销售车票.frx":09E3
OLEDBString = $"销售车票.frx":0A6C
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = $"销售车票.frx":0AF5
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label7
Caption = "剩余车票:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 3240
TabIndex = 16
Top = 4080
Width = 1455
End
Begin VB.Label Label6
Caption = "座位号:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
TabIndex = 13
Top = 4080
Width = 1335
End
Begin VB.Label Label5
Caption = "全半票:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3360
TabIndex = 11
Top = 3240
Width = 1215
End
Begin VB.Label Label4
Caption = "票价:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 240
TabIndex = 9
Top = 3240
Width = 855
End
Begin VB.Label Label3
Caption = "日:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 7920
TabIndex = 4
Top = 2400
Width = 735
End
Begin VB.Label Label2
Caption = "月:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 7920
TabIndex = 3
Top = 1560
Width = 735
End
Begin VB.Label Label1
Caption = "目标站名:"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 7800
TabIndex = 0
Top = 240
Width = 1695
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim flag As String
Private Sub Cmdfind_Click()
Dim zm As String
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
zm = "select 发车时刻表.车次,途径表.站名,车型,发车时间,检票口,发车时刻表.站名 as 班车 from 发车时刻表,途径表,车辆 where 发车时刻表.车次=途径表.车次 and 发车时刻表.车辆编号=车辆.车辆编号 and 途径表.站名='" & Combo1.Text & "'order by 发车时间 asc"
Adodc1.RecordSource = zm
Adodc1.Refresh
Text1.Text = ""
Text1.Refresh
End Sub
Private Sub Cmdok_Click()
If flag = "T" Then
Adodc8.Recordset.MoveFirst
While Not Adodc8.Recordset.EOF
If Year(Text12) = Year(Date) And Month(Text12) = Combo2.Text And Day(Text12) = Combo3.Text And Text13.Text = Text9.Text And Text3.Text = Text17.Text Then
Text25.Text = "F"
Adodc8.Recordset.Save
flag = "F"
Adodc8.Recordset.MoveLast
Else
Adodc8.Recordset.MoveNext
End If
Wend
End If
Adodc8.Recordset.AddNew
Text12.Text = Year(Date) & "/" & Val(Combo2.Text) & "/" & Val(Combo3.Text)
Text13.Text = Text9.Text
Text14.Text = Text6.Text
Text15.Text = Text2.Text
Text16.Text = Combo4.Text
Text17.Text = Text3.Text
Text18.Text = Form1.Text1.Text
Adodc8.Recordset.Update
Adodc8.Refresh
Adodc8.Recordset.MoveLast
Form6.Show
End Sub
Private Sub Combo2_LostFocus()
If Val(Combo2.Text) Mod 2 = 0 Then
If Val(Combo3.List(Combo3.ListCount - 1)) = 31 Then
Combo3.RemoveItem (Combo3.ListCount - 1)
End If
Else
If Val(Combo3.List(Combo3.ListCount - 1)) <> 31 Then
Combo3.AddItem "31"
End If
End If
End Sub
Private Sub DataGrid1_Click()
Dim cc As String, sum As Integer
sum = 0
Adodc3.Recordset.MoveFirst
Adodc4.Recordset.MoveFirst
Adodc6.Recordset.MoveFirst
Adodc7.Recordset.MoveFirst
Adodc8.Recordset.MoveFirst
If Month(Date) = Combo2.Text And Day(Date) = Combo3.Text Then
If (Hour(Text19.Text) - Hour(Now)) * 60 + Minute(Text19.Text) - Minute(Now) < 5 Then
MsgBox "已接近开车,停止售票", 64, "错误"
Cmdok.Visible = False
Else
Cmdok.Visible = True
End If
Else
Cmdok.Visible = True
End If
cc = "车型='" & Text5.Text & "'"
Adodc3.Recordset.Find cc
cc = "站名='" & Text6.Text & "'"
Adodc4.Recordset.Find cc
If Combo4.Text = "全" Then
Text2.Text = Int(Val(Text7.Text) * Val(Text8.Text) + 0.5)
Else
Text2.Text = Int(Val(Text7.Text) * Val(Text8.Text) / 2 + 0.5)
End If
Text2.Refresh
While Not Adodc8.Recordset.EOF
If Year(Text12) = Year(Date) And Month(Text12) = Combo2.Text And Day(Text12) = Combo3.Text And Text13.Text = Text9.Text And Text25.Text = "F" Then
sum = sum + 1
End If
Adodc8.Recordset.MoveNext
Wend
Text3.Text = sum + 1
Adodc8.Recordset.MoveFirst
While Not Adodc8.Recordset.EOF
If Year(Text12) = Year(Date) And Month(Text12) = Combo2.Text And Day(Text12) = Combo3.Text And Text13.Text = Text9.Text And Text25.Text = "T" Then
Text3.Text = Text17.Text
Adodc8.Recordset.MoveLast
flag = "T"
Else
Adodc8.Recordset.MoveNext
End If
Wend
While Not Adodc9.Recordset.EOF
If Year(Text22.Text) = Year(Date) And Month(Text22.Text) = Combo2.Text And Day(Text22.Text) = Combo3.Text And Text23.Text = Text9.Text Then
sum = sum + Val(Text24.Text)
End If
Adodc9.Recordset.MoveNext
Wend
cc = "车次='" & Text9.Text & "'"
Adodc7.Recordset.Find cc
cc = " 车辆编号='" & Text11.Text & "'"
Adodc6.Recordset.Find cc
Text4.Text = Val(Text10.Text) - sum
Text4.Refresh
End Sub
Private Sub Form_Load()
Adodc2.Recordset.MoveFirst
While Not Adodc2.Recordset.EOF
Combo1.AddItem Text1.Text
Adodc2.Recordset.MoveNext
Wend
Combo2.Text = Month(Date)
Combo3.Text = Day(Date)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -