📄 frmcgedaili.frm
字号:
VERSION 5.00
Begin VB.Form frmcgedaili
Caption = "神兵国际广告(北京)有限公司广告系统"
ClientHeight = 7200
ClientLeft = 60
ClientTop = 345
ClientWidth = 9585
LinkTopic = "Form1"
ScaleHeight = 7200
ScaleWidth = 9585
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text1
Height = 270
Left = 2640
TabIndex = 14
Top = 4320
Width = 975
End
Begin VB.ComboBox Combo1
Height = 300
Left = 2760
TabIndex = 13
Top = 1920
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "修改"
Height = 615
Left = 3000
TabIndex = 6
Top = 5040
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 615
Left = 5160
TabIndex = 5
Top = 5040
Width = 1335
End
Begin VB.TextBox Text2
Height = 270
Left = 6120
TabIndex = 4
Top = 1920
Width = 1335
End
Begin VB.TextBox Text3
Height = 270
Left = 2760
TabIndex = 3
Top = 2640
Width = 1455
End
Begin VB.TextBox Text4
Height = 270
Left = 6120
TabIndex = 2
Top = 2760
Width = 1335
End
Begin VB.TextBox Text5
Height = 735
Left = 2520
TabIndex = 1
Top = 3480
Width = 2295
End
Begin VB.TextBox Text6
Height = 735
Left = 6120
TabIndex = 0
Top = 3480
Width = 2055
End
Begin VB.Label Label8
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 = 16
Top = 0
Width = 9615
End
Begin VB.Label Label7
Caption = "当前id:"
Height = 255
Left = 1680
TabIndex = 15
Top = 4320
Width = 1095
End
Begin VB.Label Label1
Caption = "代理商:"
Height = 255
Left = 1680
TabIndex = 12
Top = 1920
Width = 1095
End
Begin VB.Label Label2
Caption = "联系人:"
Height = 255
Left = 5160
TabIndex = 11
Top = 1920
Width = 1095
End
Begin VB.Label Label3
Caption = "电话:"
Height = 255
Left = 1680
TabIndex = 10
Top = 2640
Width = 1095
End
Begin VB.Label Label4
Caption = "邮编:"
Height = 255
Left = 5160
TabIndex = 9
Top = 2760
Width = 1095
End
Begin VB.Label Label5
Caption = "地址:"
Height = 255
Left = 1680
TabIndex = 8
Top = 3480
Width = 1095
End
Begin VB.Label Label6
Caption = "备注:"
Height = 255
Left = 5160
TabIndex = 7
Top = 3480
Width = 1095
End
End
Attribute VB_Name = "frmcgedaili"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
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 daili where name='" & Combo1.Text & "'"
rs.Open sql, con, 1, 1
If Not rs.EOF Then
Text2.Text = rs!who
Text3.Text = rs!phone
Text4.Text = rs!postman
Text5.Text = rs!addr
Text6.Text = rs!other
Text1.Text = rs!id
Else
msg = MsgBox("当前没有任何厂商信息", 16, "错误")
Unload Me
frmmain.Show
Exit Sub
End If
rs.Close
End Sub
Private Sub Command1_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 daili where id=" & Text1.Text
rs.Open sql, con, 3, 2
If rs.EOF Then
msg = MsgBox("出错了!无法找到当前记录!", 16, "错误")
Exit Sub
End If
rs!Name = Combo1.Text
rs!who = Text2.Text
rs!phone = Text3.Text
rs!postman = Text4.Text
rs!addr = Text5.Text
rs!other = Text6.Text
rs.Update
rs.Close
Set rs = Nothing
con.Close
Set con = Nothing
msg = MsgBox("修改成功", 32, "成功")
End Sub
Private Sub Command2_Click()
Unload Me
frmmain.Show
End Sub
Private Sub Form_Load()
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 distinct name from daili order by name"
rs.Open sql, con, 1, 1
If Not rs.EOF Then
Combo1.Text = rs!Name
Else
msg = MsgBox("当前没有任何下级代理公司信息", 16, "错误")
Me.Hide
frmmain.Show
Exit Sub
End If
Do While Not rs.EOF
Combo1.AddItem (rs!Name)
rs.MoveNext
Loop
rs.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -