📄 frm_addticketinfo.frm
字号:
VERSION 5.00
Begin VB.Form frm_addticketinfo
Caption = "添加购票信息"
ClientHeight = 3900
ClientLeft = 60
ClientTop = 450
ClientWidth = 6735
LinkTopic = "Form1"
ScaleHeight = 11010
ScaleWidth = 15240
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton fault
Caption = "取消"
Height = 375
Left = 4200
TabIndex = 14
Top = 3360
Width = 1215
End
Begin VB.CommandButton cmd_OK
Caption = "添加"
Height = 375
Left = 1680
TabIndex = 13
Top = 3360
Width = 1215
End
Begin VB.Frame Frame1
Height = 3015
Left = 240
TabIndex = 0
Top = 240
Width = 6255
Begin VB.TextBox price
DataField = "ticketprice"
DataSource = "Adodc1"
Height = 285
Left = 1440
TabIndex = 18
Top = 1440
Width = 1335
End
Begin VB.TextBox tickettime
DataField = "tickettime"
DataSource = "Adodc1"
Height = 285
Left = 4320
TabIndex = 17
Top = 1080
Width = 1335
End
Begin VB.TextBox ticketNO
DataField = "ticketNO"
DataSource = "Adodc1"
Height = 285
Left = 1440
TabIndex = 15
Top = 360
Width = 1335
End
Begin VB.TextBox memo
DataField = "memo"
DataSource = "Adodc1"
Height = 885
Left = 1440
MultiLine = -1 'True
TabIndex = 12
Top = 1920
Width = 4455
End
Begin VB.TextBox arrivalcity
DataField = "arrivalcity"
DataSource = "Adodc1"
Height = 285
Left = 4320
TabIndex = 9
Top = 720
Width = 1335
End
Begin VB.TextBox ticketdate
DataField = "ticketdate"
DataSource = "Adodc1"
Height = 285
Left = 1440
TabIndex = 6
Top = 1080
Width = 1335
End
Begin VB.TextBox departcity
DataField = "departCity"
DataSource = "Adodc1"
Height = 285
Left = 1440
TabIndex = 4
Top = 720
Width = 1335
End
Begin VB.TextBox busno
DataField = "busNO"
DataSource = "Adodc1"
Height = 285
Left = 4320
TabIndex = 2
Top = 360
Width = 1335
End
Begin VB.Label Label9
Caption = "车票编号"
Height = 375
Left = 240
TabIndex = 16
Top = 360
Width = 1335
End
Begin VB.Label Label8
Caption = "备注"
Height = 375
Left = 240
TabIndex = 11
Top = 1920
Width = 1335
End
Begin VB.Label Label6
Caption = "购票价格"
Height = 255
Left = 240
TabIndex = 10
Top = 1440
Width = 855
End
Begin VB.Label Label5
Caption = "到达城市"
Height = 375
Left = 3120
TabIndex = 8
Top = 720
Width = 1335
End
Begin VB.Label Label4
Caption = "购票时间"
Height = 255
Left = 3120
TabIndex = 7
Top = 1080
Width = 975
End
Begin VB.Label Label3
Caption = "购票日期"
Height = 375
Left = 240
TabIndex = 5
Top = 1080
Width = 1335
End
Begin VB.Label Label2
Caption = "起始城市"
Height = 375
Left = 240
TabIndex = 3
Top = 720
Width = 1335
End
Begin VB.Label labelx
Caption = "汽车编号"
Height = 375
Left = 3120
TabIndex = 1
Top = 360
Width = 1335
End
End
End
Attribute VB_Name = "frm_addticketinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmd_OK_Click()
Dim strSQL As String
OpenDB
strSQL = "Select * from ticketinfo where ticketno='" + Trim(ticketNO.Text) + "'"
objRS.Open strSQL, objConn, 1, 3
If objRS.EOF Then
objRS.AddNew
objRS.Fields(0).Value = ticketNO.Text
objRS.Fields(1).Value = busno.Text
objRS.Fields(2).Value = departcity.Text
objRS.Fields(3).Value = arrivalcity.Text
objRS.Fields(4).Value = ticketdate.Text
objRS.Fields(5).Value = tickettime.Text
objRS.Fields(6).Value = CDbl(price.Text)
objRS.Fields(7).Value = memo.Text
objRS.Update
objRS.Close
CloseDB
MsgBox "记录已添加", vbOKOnly
frm_ticket.FGridDatatable.Clear
frm_ticket.ShowTitle
frm_ticket.loadData ("")
Unload Me
frm_ticket.Show
Else
MsgBox "车票编号已存在", vbOKOnly
objRS.Close
CloseDB
ticketNO.SetFocus
End If
End Sub
Private Sub fault_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -