?? 銷售車票.frm
字號:
DataSource = "Adodc2"
Height = 270
Left = 3240
TabIndex = 2
Top = 4680
Visible = 0 'False
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 = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=車站售票管理系統;Data Source=sta30"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=車站售票管理系統;Data Source=sta30"
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":014F
Left = 7920
List = "銷售車票.frx":0151
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 = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=車站售票管理系統;Data Source=sta30"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=車站售票管理系統;Data Source=sta30"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = $"銷售車票.frx":0153
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
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 + -