📄 修改商品档案.frm
字号:
VERSION 5.00
Begin VB.Form 修改商品档案
Caption = "修改商品档案"
ClientHeight = 9210
ClientLeft = 60
ClientTop = 345
ClientWidth = 10905
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 9210
ScaleWidth = 10905
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "退 出"
BeginProperty Font
Name = "华文行楷"
Size = 24
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 885
Left = 7110
TabIndex = 24
Top = 8100
Width = 2505
End
Begin VB.CommandButton Command2
Caption = "确 认"
BeginProperty Font
Name = "华文新魏"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 525
Left = 9240
TabIndex = 23
Top = 390
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "保存修改"
BeginProperty Font
Name = "华文行楷"
Size = 24
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 885
Left = 1860
TabIndex = 22
Top = 8070
Width = 2505
End
Begin VB.TextBox Text2
Height = 645
Left = 3570
TabIndex = 21
Top = 270
Width = 5145
End
Begin VB.TextBox Text1
Height = 525
Index = 0
Left = 1470
TabIndex = 9
Top = 1500
Width = 3555
End
Begin VB.TextBox Text1
Height = 525
Index = 1
Left = 1470
TabIndex = 8
Top = 2670
Width = 3555
End
Begin VB.TextBox Text1
Height = 525
Index = 2
Left = 1500
TabIndex = 7
Top = 3930
Width = 3555
End
Begin VB.TextBox Text1
Height = 525
Index = 3
Left = 1470
TabIndex = 6
Top = 5310
Width = 3555
End
Begin VB.TextBox Text1
Height = 525
Index = 4
Left = 1470
TabIndex = 5
Top = 6900
Width = 3555
End
Begin VB.TextBox Text1
Height = 525
Index = 5
Left = 6960
TabIndex = 4
Top = 1470
Width = 3555
End
Begin VB.TextBox Text1
Height = 525
Index = 6
Left = 6960
TabIndex = 3
Top = 2580
Width = 3555
End
Begin VB.TextBox Text1
Height = 525
Index = 7
Left = 6960
TabIndex = 2
Top = 3870
Width = 3555
End
Begin VB.TextBox Text1
Height = 525
Index = 8
Left = 6990
TabIndex = 1
Top = 5370
Width = 3555
End
Begin VB.TextBox Text1
Height = 525
Index = 9
Left = 6990
TabIndex = 0
Top = 6960
Width = 3555
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "请输入要修改的商品名称"
BeginProperty Font
Name = "华文行楷"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Left = 150
TabIndex = 20
Top = 390
Width = 3435
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Label1"
Height = 555
Index = 0
Left = 540
TabIndex = 19
Top = 1620
Width = 1665
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Label1"
Height = 555
Index = 1
Left = 540
TabIndex = 18
Top = 2790
Width = 1755
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Label1"
Height = 555
Index = 2
Left = 540
TabIndex = 17
Top = 4050
Width = 1755
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Label1"
Height = 555
Index = 3
Left = 540
TabIndex = 16
Top = 5520
Width = 1755
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Label1"
Height = 555
Index = 4
Left = 540
TabIndex = 15
Top = 7050
Width = 1755
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Label1"
Height = 555
Index = 5
Left = 5550
TabIndex = 14
Top = 1620
Width = 1755
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Label1"
Height = 555
Index = 6
Left = 5550
TabIndex = 13
Top = 2760
Width = 1755
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Label1"
Height = 555
Index = 7
Left = 5550
TabIndex = 12
Top = 4050
Width = 1755
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Label1"
Height = 555
Index = 8
Left = 5550
TabIndex = 11
Top = 5550
Width = 1755
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Label1"
Height = 555
Index = 9
Left = 5550
TabIndex = 10
Top = 7110
Width = 1755
End
End
Attribute VB_Name = "修改商品档案"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim txtSQL As String
Dim txtsql1(0 To 9) As String
Dim mrc As ADODB.Recordset
Dim MsgText As String
If Trim(Text2.Text) = "" Then
MsgBox "请输入要修改的商品名称!", vbOKOnly + vbExclamation, "警告"
Exit Sub
Text2.SetFocus
Else
txtSQL = "delete *from 修改商品档案管理 where" & tsql
Set mrc = ExecuteSQL(txtSQL, MsgText)
txtSQL = "select * from 修改商品档案管理"
Set mrc = ExecuteSQL(txtSQL, MsgText)
mrc.AddNew
Dim i As Integer
For i = 0 To 9
mrc.Fields(i) = Trim(Text1(i).Text)
Next i
mrc.Update
mrc.Close
MsgBox "修改商品成功!", vbOKOnly + vbExclamation, "修改商品"
Exit Sub
Unload Me
End If
End Sub
Private Sub Command2_Click()
Dim mrc As ADODB.Recordset
Dim tsql, txtSQL As String
Dim MsgText1 As String
tsql = " 商品名称 ='" & Trim((Text2.Text) & " ") & "'"
txtSQL = "select *from 修改商品档案管理 where" & tsql
Set mrc = ExecuteSQL(txtSQL, MsgText1)
Dim i As Integer
For i = 0 To 9
Text1(i).Text = mrc.Fields(i)
Next i
mrc.Update
mrc.Close
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Label1(0).Caption = "商品编码"
Label1(1).Caption = "商品名称"
Label1(2).Caption = "规格型号"
Label1(3).Caption = "经营方式"
Label1(4).Caption = "零售价格"
Label1(5).Caption = "商品库存量"
Label1(6).Caption = "商品产地"
Label1(7).Caption = "最低售价"
Label1(8).Caption = "税率"
Label1(9).Caption = "整件售价"
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call Command2_Click
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -