📄 test11.frm
字号:
VERSION 5.00
Begin VB.Form test11
Caption = "test11"
ClientHeight = 3540
ClientLeft = 60
ClientTop = 420
ClientWidth = 6495
LinkTopic = "Form2"
ScaleHeight = 3540
ScaleWidth = 6495
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 495
Index = 0
Left = 1320
TabIndex = 9
Top = 240
Width = 1815
End
Begin VB.TextBox Text1
Height = 495
Index = 1
Left = 1320
TabIndex = 8
Top = 840
Width = 1815
End
Begin VB.TextBox Text1
Height = 495
Index = 2
Left = 1320
TabIndex = 7
Top = 1440
Width = 1815
End
Begin VB.TextBox Text1
Height = 495
Index = 3
Left = 1320
TabIndex = 6
Top = 2040
Width = 1815
End
Begin VB.TextBox Text1
Height = 495
Index = 4
Left = 4320
TabIndex = 5
Top = 240
Width = 1815
End
Begin VB.TextBox Text1
Height = 495
Index = 5
Left = 4320
TabIndex = 4
Top = 840
Width = 1815
End
Begin VB.TextBox Text1
Height = 495
Index = 6
Left = 4320
TabIndex = 3
Top = 1440
Width = 1815
End
Begin VB.TextBox Text1
Height = 495
Index = 7
Left = 4320
TabIndex = 2
Top = 2040
Width = 1815
End
Begin VB.CommandButton Command1
Caption = "保 存"
Height = 615
Left = 1320
TabIndex = 1
Top = 2760
Width = 1575
End
Begin VB.CommandButton Command2
Caption = "取 消"
Height = 615
Left = 3600
TabIndex = 0
Top = 2760
Width = 1695
End
Begin VB.Label Label1
Caption = "商品编号"
Height = 375
Index = 0
Left = 360
TabIndex = 17
Top = 360
Width = 735
End
Begin VB.Label Label1
Caption = "商品名称"
Height = 375
Index = 1
Left = 360
TabIndex = 16
Top = 960
Width = 735
End
Begin VB.Label Label1
Caption = "商品简称"
Height = 375
Index = 2
Left = 360
TabIndex = 15
Top = 1560
Width = 735
End
Begin VB.Label Label1
Caption = "规 格"
Height = 375
Index = 3
Left = 360
TabIndex = 14
Top = 2160
Width = 735
End
Begin VB.Label Label1
Caption = "产 地"
Height = 375
Index = 4
Left = 3360
TabIndex = 13
Top = 360
Width = 735
End
Begin VB.Label Label1
Caption = "单 位"
Height = 375
Index = 5
Left = 3360
TabIndex = 12
Top = 960
Width = 735
End
Begin VB.Label Label1
Caption = "单 价"
Height = 375
Index = 6
Left = 3360
TabIndex = 11
Top = 1560
Width = 735
End
Begin VB.Label Label1
Caption = "库存数量"
Height = 375
Index = 7
Left = 3360
TabIndex = 10
Top = 2160
Width = 735
End
End
Attribute VB_Name = "test11"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command2_Click()
test11.Visible = False
End Sub
Private Sub Command1_Click()
test1.Adodc1.RecordSource = "Update 商品信息表 set 商品编号=" + Text1(0).Text + "商品名称=" + Text1(1).Text + "商品简称=" + Text1(2).Text + "规格=" + Text1(3).Text + "产地=" + Text1(4).Text + "单位=" + Text1(5).Text + "单价=" + Text1(6).Text + "库存数量" + Text1(7).Text + "" + Text1(7).Text + ""
With test1.Adodc1.Recordset
If .RecordCount > 0 Then
.Fields("商品编号") = Text1(0).Text
.Fields("商品名称") = Text1(1).Text
.Fields("商品简称") = Text1(2).Text
.Fields("规格") = Text1(3).Text
.Fields("产地") = Text1(4).Text
.Fields("单位") = Text1(5).Text
.Fields("单价") = Text1(6).Text
.Fields("库存数量") = Text1(7).Text
.Update
End If
End With
MsgBox "数据保存成功!!", 32, "销售管理系统"
Command1.Enabled = False
test11.Visible = False
End Sub
Private Sub Form_Load()
test11.Text1(0).Text = test1.Text1(0).Text
test11.Text1(1).Text = test1.Text1(1).Text
test11.Text1(2).Text = test1.Text1(2).Text
test11.Text1(3).Text = test1.Text1(3).Text
test11.Text1(4).Text = test1.Text1(4).Text
test11.Text1(5).Text = test1.Text1(5).Text
test11.Text1(6).Text = test1.Text1(6).Text
test11.Text1(7).Text = test1.Text1(7).Text
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -