📄 frmtoufang.frm
字号:
VERSION 5.00
Begin VB.Form frmtoufang
Caption = "神兵国际广告(北京)有限公司广告系统"
ClientHeight = 7200
ClientLeft = 60
ClientTop = 345
ClientWidth = 9585
LinkTopic = "Form1"
ScaleHeight = 7200
ScaleWidth = 9585
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取 消"
Height = 375
Left = 5040
TabIndex = 28
Top = 6240
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "添 加"
Height = 375
Left = 2280
TabIndex = 27
Top = 6240
Width = 1575
End
Begin VB.TextBox Text10
Height = 735
Left = 2400
TabIndex = 26
Top = 5280
Width = 3135
End
Begin VB.TextBox Text9
Height = 270
Left = 6840
TabIndex = 25
Top = 4680
Width = 1455
End
Begin VB.TextBox Text8
Height = 270
Left = 2280
TabIndex = 24
Top = 4440
Width = 1455
End
Begin VB.TextBox Text7
Height = 270
Left = 6480
TabIndex = 23
Top = 3840
Width = 1455
End
Begin VB.TextBox Text6
Height = 270
Left = 6840
TabIndex = 22
Top = 3120
Width = 855
End
Begin VB.ComboBox Combo3
Height = 300
Left = 2400
TabIndex = 21
Top = 3720
Width = 1455
End
Begin VB.ComboBox Combo2
Height = 300
Left = 2400
TabIndex = 20
Top = 3000
Width = 1335
End
Begin VB.TextBox Text5
Height = 270
Left = 6600
TabIndex = 19
Top = 2520
Width = 1215
End
Begin VB.TextBox Text4
Height = 270
Left = 2400
TabIndex = 18
Top = 2400
Width = 1335
End
Begin VB.TextBox Text3
Height = 270
Left = 6480
TabIndex = 16
Top = 1920
Width = 1215
End
Begin VB.TextBox Text2
Height = 270
Left = 2280
TabIndex = 15
Top = 1800
Width = 1335
End
Begin VB.TextBox Text1
Height = 270
Left = 6480
TabIndex = 14
Top = 1080
Width = 1335
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "frmtoufang.frx":0000
Left = 2280
List = "frmtoufang.frx":0002
Sorted = -1 'True
TabIndex = 13
Text = "Combo1"
Top = 1080
Width = 1455
End
Begin VB.CheckBox Check1
Caption = "状态(未播/已播)"
Height = 375
Left = 6120
TabIndex = 12
Top = 5400
Width = 1935
End
Begin VB.Label Label14
Alignment = 2 'Center
BackColor = &H00FF8080&
BorderStyle = 1 'Fixed Single
Caption = " 广 告 投 放 信 息 添 加 "
BeginProperty Font
Name = "隶书"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 495
Left = 0
TabIndex = 29
Top = 0
Width = 9615
End
Begin VB.Label Label13
Caption = "备注:"
Height = 375
Left = 1320
TabIndex = 17
Top = 5280
Width = 1455
End
Begin VB.Label Label12
Caption = "播放要求(广告排位要求):"
Height = 375
Left = 4440
TabIndex = 11
Top = 4680
Width = 2655
End
Begin VB.Label Label11
Caption = "时段说明:"
Height = 255
Left = 1200
TabIndex = 10
Top = 4440
Width = 1575
End
Begin VB.Label Label10
Caption = "时段名称:"
Height = 375
Left = 5400
TabIndex = 9
Top = 3840
Width = 1455
End
Begin VB.Label Label9
Caption = "广告内容:"
Height = 375
Left = 1200
TabIndex = 8
Top = 3720
Width = 1695
End
Begin VB.Label Label8
Caption = "广告版本类别:"
Height = 375
Left = 5400
TabIndex = 7
Top = 3120
Width = 1575
End
Begin VB.Label Label7
Caption = "广告品牌:"
Height = 375
Left = 1320
TabIndex = 6
Top = 3000
Width = 1455
End
Begin VB.Label Label6
Caption = "结束日期:"
Height = 255
Left = 5400
TabIndex = 5
Top = 2520
Width = 1455
End
Begin VB.Label Label5
Caption = "签约日期:"
Height = 375
Left = 1200
TabIndex = 4
Top = 2400
Width = 1455
End
Begin VB.Label Label4
Caption = "开始日期:"
Height = 255
Left = 5400
TabIndex = 3
Top = 1920
Width = 1455
End
Begin VB.Label Label3
Caption = "频道:"
Height = 255
Left = 1200
TabIndex = 2
Top = 1800
Width = 1215
End
Begin VB.Label Label2
Caption = "相关协议号:"
Height = 375
Left = 5400
TabIndex = 1
Top = 1080
Width = 1575
End
Begin VB.Label Label1
Caption = "合同草稿号:"
Height = 255
Left = 1080
TabIndex = 0
Top = 1080
Width = 1455
End
End
Attribute VB_Name = "frmtoufang"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Change()
Dim sql As String
Dim str As String
Dim con As ADODB.Connection
Set con = New Connection
str = "provider=microsoft.jet.oledb.4.0;Data Source=" & App.Path & "\database.mdb"
con.Open str
Dim rs As ADODB.Recordset
Set rs = New Recordset
sql = "select * from hetong where hetong_no='" & Combo1.Text & "'"
rs.Open sql, con, 1, 1
If Not rs.EOF Then
Text1.Text = rs!xgxy_no
Text2.Text = rs!pingdao
Text3.Text = rs!start_date
Text4.Text = rs!qianyue_date
Text5.Text = rs!end_date
End If
rs.Close
Set rs = Nothing
con.Close
Set con = Nothing
End Sub
Private Sub Combo1_Click()
Dim sql As String
Dim str As String
Dim con As ADODB.Connection
Set con = New Connection
str = "provider=microsoft.jet.oledb.4.0;Data Source=" & App.Path & "\database.mdb"
con.Open str
Dim rs As ADODB.Recordset
Set rs = New Recordset
sql = "select * from hetong where hetong_no='" & Combo1.Text & "'"
rs.Open sql, con, 1, 1
If Not rs.EOF Then
Text1.Text = rs!xgxy_no
Text2.Text = rs!pingdao
Text3.Text = rs!start_date
Text4.Text = rs!qianyue_date
Text5.Text = rs!end_date
End If
rs.Close
Set rs = Nothing
con.Close
Set con = Nothing
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Combo2_Change()
Combo3.Clear
Dim sql As String
Dim str As String
Dim con As ADODB.Connection
Set con = New Connection
str = "provider=microsoft.jet.oledb.4.0;Data Source=" & App.Path & "\database.mdb"
con.Open str
Dim rs As ADODB.Recordset
Set rs = New Recordset
sql = "select * from changshang where logo='" & Combo2.Text & "'"
rs.Open sql, con, 1, 1
If Not rs.EOF Then
Combo3.Text = rs!content
End If
Do While Not rs.EOF
Combo3.AddItem (rs!content)
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
con.Close
Set con = Nothing
End Sub
Private Sub Combo2_Click()
Combo3.Clear
Dim sql As String
Dim str As String
Dim con As ADODB.Connection
Set con = New Connection
str = "provider=microsoft.jet.oledb.4.0;Data Source=" & App.Path & "\database.mdb"
con.Open str
Dim rs As ADODB.Recordset
Set rs = New Recordset
sql = "select * from changshang where logo='" & Combo2.Text & "'"
rs.Open sql, con, 1, 1
If Not rs.EOF Then
Combo3.Text = rs!content
End If
Do While Not rs.EOF
Combo3.AddItem (rs!content)
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
con.Close
Set con = Nothing
End Sub
Private Sub Combo2_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Combo3_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Command1_Click()
If Combo1.Text = "" Then
msg = MsgBox("请完整输入字段", 16, "错误")
Combo1.SetFocus
Exit Sub
End If
If Combo2.Text = "" Then
msg = MsgBox("请完整输入字段", 16, "错误")
Combo2.SetFocus
Exit Sub
End If
If Combo3.Text = "" Then
msg = MsgBox("请完整输入字段", 16, "错误")
Combo3.SetFocus
Exit Sub
End If
If Text1.Text = "" Then
msg = MsgBox("请完整输入字段", 16, "错误")
Text1.SetFocus
Exit Sub
End If
If Text2.Text = "" Then
msg = MsgBox("请完整输入字段", 16, "错误")
Text2.SetFocus
Exit Sub
End If
If Text3.Text = "" Then
msg = MsgBox("请完整输入字段", 16, "错误")
Text3.SetFocus
Exit Sub
End If
If Text4.Text = "" Then
msg = MsgBox("请完整输入字段", 16, "错误")
Text4.SetFocus
Exit Sub
End If
If Text5.Text = "" Then
msg = MsgBox("请完整输入字段", 16, "错误")
Text5.SetFocus
Exit Sub
End If
If Text6.Text = "" Then
msg = MsgBox("请完整输入字段", 16, "错误")
Text6.SetFocus
Exit Sub
End If
If Text7.Text = "" Then
msg = MsgBox("请完整输入字段", 16, "错误")
Text7.SetFocus
Exit Sub
End If
If Text8.Text = "" Then
msg = MsgBox("请完整输入字段", 16, "错误")
Text8.SetFocus
Exit Sub
End If
If Text9.Text = "" Then
msg = MsgBox("请完整输入字段", 16, "错误")
Text9.SetFocus
Exit Sub
End If
If Text10.Text = "" Then
msg = MsgBox("请完整输入字段", 16, "错误")
Text10.SetFocus
Exit Sub
End If
Dim sql As String
Dim str As String
Dim con As ADODB.Connection
Set con = New Connection
str = "provider=microsoft.jet.oledb.4.0;Data Source=" & App.Path & "\database.mdb"
con.Open str
con.Execute "insert into [toufang]([hetong_no],[xgxy_no],[pingdao],[start_date],qianyue_date,end_date,logo,bete,content,playtimename,playtimeinfo,playconntent,ishaveplay,other) values ('" & Trim(Combo1.Text) & "','" & Trim(Text1.Text) & "','" & Trim(Text2.Text) & "','" & Trim(Text3.Text) & "','" & Trim(Text4.Text) & "','" & Trim(Text5.Text) & "','" & Trim(Combo2.Text) & "','" & Trim(Text6.Text) & "','" & Trim(Combo3.Text) & "','" & Trim(Text7.Text) & "','" & Trim(Text8.Text) & "','" & Trim(Text9.Text) & "'," & Check1.Value & ",'" & Trim(Text10.Text) & "')"
con.Close
Set con = Nothing
msg = MsgBox("恭喜!添加厂商信息成功", 64, "信息")
Unload Me
frmmain.Show
End Sub
Private Sub Command2_Click()
Unload Me
frmmain.Show
End Sub
Private Sub Form_Load()
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Dim sql As String
Dim str As String
Dim con As ADODB.Connection
Set con = New Connection
str = "provider=microsoft.jet.oledb.4.0;Data Source=" & App.Path & "\database.mdb"
con.Open str
Dim rs As ADODB.Recordset
Set rs = New Recordset
sql = "select * from hetong where whoown='" & frmLogin.username & "'"
rs.Open sql, con, 1, 1
If Not rs.EOF Then
Combo1.Text = rs!hetong_no
Else
unloadme
Exit Sub
End If
Do While Not rs.EOF
Combo1.AddItem (rs!hetong_no)
rs.MoveNext
Loop
rs.Close
sql = "select distinct logo as logo from changshang"
rs.Open sql, con, 1, 1
If Not rs.EOF Then
Combo2.Text = rs!logo
End If
Do While Not rs.EOF
Combo2.AddItem (rs!logo)
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
con.Close
Set con = Nothing
End Sub
Public Function unloadme()
msg = MsgBox("如需添加广告投放信息必须先添加广告合同信息", 16, "错误")
frmtoufang.Hide
frmenterguanggao.Show
Unload frmtoufang
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -