📄 添加物资.frm
字号:
VERSION 5.00
Begin VB.Form Form8
Caption = "Form8"
ClientHeight = 3510
ClientLeft = 60
ClientTop = 345
ClientWidth = 5670
LinkTopic = "Form8"
ScaleHeight = 3510
ScaleWidth = 5670
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "退 出"
Height = 495
Left = 3240
TabIndex = 10
Top = 2640
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "添 加"
Height = 495
Left = 1080
TabIndex = 9
Top = 2640
Width = 1215
End
Begin VB.Frame Frame1
Caption = "请输入"
Height = 2295
Left = 120
TabIndex = 0
Top = 0
Width = 5535
Begin VB.TextBox Text4
Height = 495
Left = 3600
TabIndex = 8
Top = 1320
Width = 1215
End
Begin VB.TextBox Text3
Height = 495
Left = 1080
TabIndex = 7
Top = 1320
Width = 1215
End
Begin VB.TextBox Text2
Height = 495
Left = 3600
TabIndex = 6
Top = 480
Width = 1215
End
Begin VB.TextBox Text1
Height = 495
Left = 1080
TabIndex = 5
Top = 480
Width = 1215
End
Begin VB.Label Label4
Caption = "单价:"
Height = 495
Left = 3000
TabIndex = 4
Top = 1440
Width = 615
End
Begin VB.Label Label3
Caption = "数量:"
Height = 495
Left = 480
TabIndex = 3
Top = 1440
Width = 615
End
Begin VB.Label Label2
Caption = "物资名称:"
Height = 495
Left = 2640
TabIndex = 2
Top = 600
Width = 1095
End
Begin VB.Label Label1
Caption = "物资号:"
Height = 495
Left = 360
TabIndex = 1
Top = 600
Width = 855
End
End
End
Attribute VB_Name = "Form8"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim strInsert As String
strInsert = "insert into 物资表 values('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "')"
mycon.BeginTrans
mycon.Execute (strInsert)
mycon.CommitTrans
MsgBox "添加成功", vbInformation, "提示"
Text1.Text = "": Text2.Text = "": Text3.Text = "": Text4.Text = ""
Text1.SetFocus
Exit Sub
errhandle:
MsgBox "添加失败", vbInformation, "提示"
mycon.RollbackTrans
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -