📄 登记入库单.frm
字号:
VERSION 5.00
Begin VB.Form 登记入库单
Caption = "登记入库单"
ClientHeight = 5910
ClientLeft = 4305
ClientTop = 2925
ClientWidth = 8070
FillStyle = 0 'Solid
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 5910
ScaleWidth = 8070
Begin VB.CommandButton Command5
Caption = "退 出"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4680
TabIndex = 9
Top = 4800
Width = 1215
End
Begin VB.CommandButton Command4
Caption = "入库确认"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1920
TabIndex = 8
Top = 4800
Width = 1215
End
Begin VB.Frame Frame2
Height = 3255
Left = 480
TabIndex = 0
Top = 840
Width = 7215
Begin VB.ListBox List1
Height = 2220
Left = 4560
TabIndex = 10
Top = 480
Width = 2175
End
Begin VB.ComboBox Combo3
Height = 300
Left = 1440
TabIndex = 7
Top = 1440
Width = 1095
End
Begin VB.TextBox Text4
Height = 270
Left = 1440
TabIndex = 5
Top = 2400
Width = 1095
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1440
TabIndex = 2
Top = 480
Width = 1695
End
Begin VB.Label Label2
Caption = "商品名称"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3480
TabIndex = 6
Top = 480
Width = 1095
End
Begin VB.Label Label6
Caption = "数 量"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 4
Top = 2400
Width = 855
End
Begin VB.Label Label5
Caption = "单 位"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 3
Top = 1440
Width = 975
End
Begin VB.Label Label3
Caption = "商品编号"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 1
Top = 480
Width = 1095
End
End
Begin VB.Image Image1
Height = 5955
Left = 0
Picture = "登记入库单.frx":0000
Top = 0
Width = 8505
End
End
Attribute VB_Name = "登记入库单"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_click()
Dim rs As ADODB.Recordset
Dim sql As String
sql = "select * from spxxb where spbh=" & Trim(Combo1.Text)
Set rs = exesql(sql)
If rs.RecordCount > 0 Then '将选中的商品编号的商品名称和单位加到文本框中
List1.Text = Trim(rs.Fields("spmc"))
Combo3.Text = Trim(rs.Fields("dw"))
End If
Set rs = Nothing
End Sub
Private Sub list1_click()
Dim rs As ADODB.Recordset
Dim sql As String
sql = "select * from spxxb where spmc='" & Trim(List1.Text) & "'"
Set rs = exesql(sql)
If rs.RecordCount > 0 Then '将选中的商品对应的商品编号和单位加到文本框中
Combo1.Text = Trim(rs.Fields("spbh"))
Combo3.Text = Trim(rs.Fields("dw"))
End If
Set rs = Nothing
End Sub
Private Sub Command4_Click()
Dim sql As String
Dim i As String
Dim rs As ADODB.Recordset
If Trim("text4.text") <> "" Then '判断数量是否为空
If Trim(Combo1.Text) <> "" Then '判断商品编号是否为空
If Trim(List1.Text) <> "" Then '判断商品名称是否为空
If Trim(Combo3.Text) <> "" Then '判断单位是否为空
sql = "select * from spxxb where spbh=" & Trim(Combo1.Text)
Set rs = exesql(sql)
If rs.RecordCount > 0 Then '判断商品编号是否存在
sql = "select * from spxxb where spmc='" & Trim(List1.Text) & "'"
Set rs = exesql(sql)
If rs.RecordCount > 0 Then '判断商品名称是否真实
If Trim(rs.Fields("dw")) = Trim(Combo3.Text) Then '判断单位是否对应
sql = "select * from spxxb where spbh=" & Trim(Combo1.Text)
Set rs = exesql(sql)
rs.Fields("sl") = rs.Fields("sl") + Val(Trim(Text4.Text)) '库存数量添加
rs.Update
Set rs = Nothing
MsgBox "入库成功!"
Else: MsgBox "此商品单位不对应!"
Combo3.SetFocus
End If
Else: MsgBox "此商品名称不存在!"
List1.SetFocus
End If
Else: MsgBox "此商品编号不存在!"
Combo1.SetFocus
End If
Else: MsgBox "单位不能为空!"
Combo3.SetFocus
End If
Else: MsgBox "商品名称不能为空!"
List1.SetFocus
End If
Else: MsgBox "商品编号不能为空!"
Combo1.SetFocus
End If
Else: MsgBox "数量不能为空!"
Text4.SetFocus
End If
End Sub
Private Sub Command5_Click()
Unload 登记入库单
End Sub
Private Sub Form_Load() '将数据加载到相应控件
Call listinitial("spbh", Combo1)
Call listinitial("spmc", List1)
Call listinitial("dw", Combo3)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -