📄 test12.frm
字号:
VERSION 5.00
Begin VB.Form test12
Caption = "Form1"
ClientHeight = 2880
ClientLeft = 60
ClientTop = 420
ClientWidth = 7470
LinkTopic = "Form1"
ScaleHeight = 2880
ScaleWidth = 7470
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 375
Index = 0
Left = 1200
TabIndex = 9
Top = 240
Width = 1575
End
Begin VB.TextBox Text1
Height = 375
Index = 1
Left = 1200
TabIndex = 8
Top = 840
Width = 1575
End
Begin VB.TextBox Text1
Height = 375
Index = 2
Left = 1200
TabIndex = 7
Top = 1320
Width = 1575
End
Begin VB.TextBox Text1
Height = 375
Index = 3
Left = 1200
TabIndex = 6
Top = 1920
Width = 1575
End
Begin VB.TextBox Text1
Height = 375
Index = 4
Left = 3720
TabIndex = 5
Top = 240
Width = 1575
End
Begin VB.TextBox Text1
Height = 375
Index = 5
Left = 3720
TabIndex = 4
Top = 840
Width = 1575
End
Begin VB.TextBox Text1
Height = 375
Index = 6
Left = 3720
TabIndex = 3
Top = 1320
Width = 1575
End
Begin VB.TextBox Text1
Height = 375
Index = 7
Left = 3720
TabIndex = 2
Top = 1920
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "新增商品"
Height = 495
Left = 5640
TabIndex = 1
Top = 480
Width = 1335
End
Begin VB.CommandButton Command2
Caption = "返回"
Height = 495
Left = 5640
TabIndex = 0
Top = 1320
Width = 1335
End
Begin VB.Label Label1
Caption = "商品编号"
Height = 375
Index = 0
Left = 240
TabIndex = 17
Top = 240
Width = 735
End
Begin VB.Label Label1
Caption = "商品名称"
Height = 375
Index = 1
Left = 240
TabIndex = 16
Top = 840
Width = 735
End
Begin VB.Label Label1
Caption = "商品简称"
Height = 375
Index = 2
Left = 240
TabIndex = 15
Top = 1440
Width = 735
End
Begin VB.Label Label1
Caption = "规 格"
Height = 375
Index = 3
Left = 240
TabIndex = 14
Top = 2040
Width = 735
End
Begin VB.Label Label1
Caption = "产 地"
Height = 375
Index = 4
Left = 2880
TabIndex = 13
Top = 240
Width = 735
End
Begin VB.Label Label1
Caption = "单 位"
Height = 375
Index = 5
Left = 2880
TabIndex = 12
Top = 840
Width = 735
End
Begin VB.Label Label1
Caption = "单 价"
Height = 375
Index = 6
Left = 2880
TabIndex = 11
Top = 1440
Width = 735
End
Begin VB.Label Label1
Caption = "库存数量"
Height = 375
Index = 7
Left = 2880
TabIndex = 10
Top = 2040
Width = 735
End
End
Attribute VB_Name = "test12"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
test1.Adodc1.RecordSource = "insert into 商品信息表 values(" + Text1(0).Text + "," + Text1(1).Text + "," + Text1(2).Text + "," + Text1(3).Text + "," + Text1(4).Text + "," + Text1(4).Text + "," + Text1(5).Text + "," + Text1(6).Text + "," + Text1(7).Text + ")"
With test1.Adodc1.Recordset
.AddNew
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, "销售管理系统"
test12.Visible = False
End Sub
Private Sub Command2_Click()
test12.Visible = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -