📄 chanpin.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form chanpin
Caption = "产品修改"
ClientHeight = 7500
ClientLeft = 60
ClientTop = 465
ClientWidth = 10455
ScaleHeight = 7500
ScaleWidth = 10455
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 270
Left = 8760
TabIndex = 21
Top = 2400
Width = 975
End
Begin VB.Frame Frame2
Caption = "待修改批次"
Height = 735
Left = 8640
TabIndex = 20
Top = 2160
Width = 1335
End
Begin VB.ListBox List1
Height = 2220
Left = 8040
TabIndex = 17
Top = 3120
Width = 1935
End
Begin VB.ComboBox Combo3
Height = 300
Left = 8040
TabIndex = 14
Top = 360
Width = 1695
End
Begin VB.Frame Frame1
Caption = "提示"
Height = 2415
Left = 360
TabIndex = 13
Top = 3000
Width = 6975
Begin VB.Label Label11
Caption = "只有选中列表中的批次才能够对产品进行修改"
Height = 375
Left = 360
TabIndex = 22
Top = 1440
Width = 5655
End
Begin VB.Label Label9
Caption = "注意:灰色字体的待修改批次才是真正要修改的批次"
ForeColor = &H00FF0000&
Height = 495
Left = 360
TabIndex = 19
Top = 1080
Width = 5775
End
Begin VB.Label Label10
Caption = "型号一栏填入要修改的产品型号,如果这一天有多次入库,注意选择批次"
Height = 375
Left = 360
TabIndex = 15
Top = 720
Width = 6015
End
End
Begin VB.CommandButton Command2
Caption = "退 出"
Height = 1095
Left = 6360
TabIndex = 12
Top = 5880
Width = 2775
End
Begin VB.CommandButton Command1
Caption = "修 改"
Height = 1095
Left = 840
TabIndex = 11
Top = 5880
Width = 2415
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 8040
TabIndex = 10
Top = 1560
Width = 1815
_ExtentX = 3201
_ExtentY = 661
_Version = 393216
Format = 226623489
CurrentDate = 39232
End
Begin VB.TextBox Text2
Height = 375
Left = 1200
TabIndex = 9
Top = 1560
Width = 1695
End
Begin VB.TextBox Text3
Height = 375
Left = 4320
TabIndex = 7
Top = 1560
Width = 1455
End
Begin VB.ComboBox Combo2
Height = 300
Left = 4320
TabIndex = 2
Top = 360
Width = 1695
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1200
TabIndex = 0
Top = 360
Width = 1695
End
Begin VB.Label Label7
Caption = "修改成功"
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 615
Left = 5160
TabIndex = 18
Top = 2280
Visible = 0 'False
Width = 2055
End
Begin VB.Label Label8
Caption = "批次:"
Height = 375
Left = 7920
TabIndex = 16
Top = 2640
Width = 735
End
Begin VB.Label Label6
Caption = "入库日期"
Height = 375
Left = 6720
TabIndex = 8
Top = 1560
Width = 1095
End
Begin VB.Label Label5
Caption = "单价"
Height = 375
Left = 3240
TabIndex = 6
Top = 1680
Width = 1215
End
Begin VB.Label Label4
Caption = "数量"
Height = 375
Left = 480
TabIndex = 5
Top = 1680
Width = 1095
End
Begin VB.Label Label3
Caption = "型号"
Height = 375
Left = 6720
TabIndex = 4
Top = 360
Width = 1215
End
Begin VB.Label Label2
Caption = "品牌"
Height = 375
Left = 3240
TabIndex = 3
Top = 360
Width = 735
End
Begin VB.Label Label1
Caption = "产品分类"
Height = 375
Left = 360
TabIndex = 1
Top = 360
Width = 735
End
End
Attribute VB_Name = "chanpin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo3_Change()
List1.Clear
Label7.Visible = False
If Combo1.Text = "" Or Combo2.Text = "" Then
Exit Sub
Else
Dim rst As Recordset
Dim db As Connection
Set rst = New Recordset
' Set rs2 = New Recordset
Set db = New Connection
conn = "select * from 产品类别 where 类别名称 ='" & Combo1 & "'"
Debug.Print conn
db.CursorLocation = adUseClient
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Database.mdb;Persist Security Info=False"
rst.Open conn, db, adOpenDynamic, adLockOptimistic
If Not rst.EOF Then
aaa = rst.Fields("id")
Else
Exit Sub
End If
rst.Close
conn = "select * from 生产厂家 where 品牌 ='" & Combo2 & "'"
rst.Open conn, db, adOpenDynamic, adLockOptimistic
If Not rst.EOF Then
bbb = rst.Fields("id")
Else
Exit Sub
End If
rst.Close
If Not Combo3.Text = "" Then
conn = "select * from 产品库存 where 生产厂家=" & bbb & " and 产品类别=" & aaa & " and 产品型号='" & Combo3.Text & "'"
Debug.Print conn
rst.Open conn, db, adOpenDynamic, adLockOptimistic
Do Until rst.EOF
List1.AddItem rst.Fields("id")
rst.MoveNext
Loop
rst.Close
Else
Exit Sub
End If
End If
End Sub
Private Sub Combo3_Click()
List1.Clear
Label7.Visible = False
If Combo1.Text = "" Or Combo2.Text = "" Then
Exit Sub
Else
Dim rst As Recordset
Dim db As Connection
Set rst = New Recordset
' Set rs2 = New Recordset
Set db = New Connection
conn = "select * from 产品类别 where 类别名称 ='" & Combo1 & "'"
db.CursorLocation = adUseClient
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Database.mdb;Persist Security Info=False"
rst.Open conn, db, adOpenDynamic, adLockOptimistic
If Not rst.EOF Then
aaa = rst.Fields("id")
Else
Exit Sub
End If
rst.Close
conn = "select * from 生产厂家 where 品牌 ='" & Combo2 & "'"
rst.Open conn, db, adOpenDynamic, adLockOptimistic
If Not rst.EOF Then
bbb = rst.Fields("id")
Else
Exit Sub
End If
rst.Close
If Not Combo3.Text = "" Then
conn = "select * from 产品库存 where 生产厂家=" & bbb & " and 产品类别=" & aaa & "and 产品型号='" & Combo3.Text & "'"
'conn = "select * from 产品库存 where 生产厂家=" & bbb & " and 产品类别=" & aaa & " and 产品型号='" & Combo3.Text & "' and 入库日期='" & DTPicker1.Value & "'"
rst.Open conn, db, adOpenDynamic, adLockOptimistic
Debug.Print conn
Do Until rst.EOF
List1.AddItem rst.Fields("id")
rst.MoveNext
Loop
rst.Close
Else
Exit Sub
End If
End If
End Sub
Private Sub Command1_Click()
If Combo1.Text = "" Or Text2 < 1 Or Text3 <= 0 Or Combo2.Text = "" Or Combo3.Text = "" Or Text1 = "" Or Text2 = "" Or Text3 = "" Or Not IsNumeric(Text3) Or Not IsNumeric(Text2) Then
Exit Sub
Else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -