📄 frmproductout.frm
字号:
End If
If rs!件数 < Val(txtCount.Text) Then
MsgBox "仓库中此种产品余量不足,件数为" & Str(rs!件数)
rs.Close
cn.Close
Exit Sub
Else
rs!件数 = rs!件数 - Val(txtCount.Text)
End If
rs.Update
rs.Close
cn.Close
Case "复合片":
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockPessimistic
rs.CursorType = adOpenKeyset
If chkYouZhiXinFuHe.Value = 1 Then
rs.Open "select * from 复合片库存表 where 长度 = '" & ComboLangthFuHe.Text & "' and 宽度 = '" & ComboWidthFuHe.Text & "' and 厚度 = '" & ComboHouDuFuHe.Text & "' and 颜色 = '" & ComboColorFuHe.Text & "' and 存放位置 = '" & ComboPostion.Text & "'and 纸芯 = true and 层数 = '" & txtCengShuFuhe.Text & "'"
Else
rs.Open "select * from 复合片库存表 where 长度 = '" & ComboLangthFuHe.Text & "' and 宽度 = '" & ComboWidthFuHe.Text & "' and 厚度 = '" & ComboHouDuFuHe.Text & "' and 颜色 = '" & ComboColorFuHe.Text & "' and 存放位置 = '" & ComboPostion.Text & "'and 纸芯 = False and 层数 = '" & txtCengShuFuhe.Text & "'"
End If
If rs.EOF Then
MsgBox "仓库中无此类产品!", , "提示"
rs.Close
cn.Close
Exit Sub
End If
If rs!件数 < Val(txtCount.Text) Then
MsgBox "仓库中此种产品余量不足,件数为" & Str(rs!件数)
rs.Close
cn.Close
Exit Sub
Else
rs!件数 = rs!件数 - Val(txtCount.Text)
End If
rs.Update
rs.Close
cn.Close
Case "轧花片":
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockPessimistic
rs.CursorType = adOpenKeyset
Dim sqlString As String
If chkDanShuangMian.Value = 1 Then
sqlString = "select 件数 from 轧花片库存表 where 长度 = '" & ComboLangthYaHua.Text & "' and 宽度 = '" & ComboWidthYaHua.Text & "' and 厚度 = '" & ComboHouDuYaHua.Text & "' and 颜色 = '" & ComboColorYaHua.Text & "' and 单双面 = 1 and 膜厚 = '" & ComboMoHouYaHua.Text & "' and 存放位置 = '" & ComboPostion.Text & "'"
Else
sqlString = "select 件数 from 轧花片库存表 where 长度 = '" & ComboLangthYaHua.Text & "' and 宽度 = '" & ComboWidthYaHua.Text & "' and 厚度 = '" & ComboHouDuYaHua.Text & "' and 颜色 = '" & ComboColorYaHua.Text & "' and 单双面 = 0 and 膜厚 = '" & ComboMoHouYaHua.Text & "' and 存放位置 = '" & ComboPostion.Text & "'"
End If
If chkYouZhiXinYaHua.Value = 1 Then
sqlString = sqlString & " and 纸芯 = true"
Else
sqlString = sqlString & " and 纸芯 = false"
End If
rs.Open sqlString
If rs.EOF Then
MsgBox "仓库中无此类产品!", , "提示"
rs.Close
cn.Close
Exit Sub
End If
If rs!件数 < Val(txtCount.Text) Then
MsgBox "仓库中此种产品余量不足,件数为" & Str(rs!件数)
rs.Close
cn.Close
Exit Sub
Else
rs!件数 = rs!件数 - Val(txtCount.Text)
End If
rs.Update
rs.Close
cn.Close
Case "淋膜制品":
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockPessimistic
rs.CursorType = adOpenKeyset
rs.Open "select * from 淋膜制品库存表 where 长度 = '" & ComboLangthLinMo.Text & "' and 宽度 = '" & ComboWidthLinMo.Text & "' and 颜色 = '" & comboColorLinMo.Text & "' and 第一层名称 = '" & ComboFirstName.Text & "' and 第一层厚度 = '" & ComboFirstHouDu.Text & "' and 第二层名称 = '" & ComboSecondName.Text & "' and 第二层厚度 = '" & ComboSecondHouDu.Text & "' and 第三层名称 = '" & ComboThirdName.Text & "' and 第三层厚度 = '" & ComboThirdHouDu.Text & "' and 存放位置 = '" & ComboPostion.Text & "'"
If rs.EOF Then
MsgBox "仓库中无此类产品!", , "提示"
rs.Close
cn.Close
Exit Sub
End If
If rs!件数 < Val(txtCount.Text) Then
MsgBox "仓库中此种产品余量不足,件数为" & Str(rs!件数)
rs.Close
cn.Close
Exit Sub
Else
rs!件数 = rs!件数 - Val(txtCount.Text)
End If
rs.Update
rs.Close
cn.Close
Case "定位包装":
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockPessimistic
rs.CursorType = adOpenKeyset
rs.Open "select * from 定位包装库存表 where 厂家 = '" & comboChangJiaDingWei.Text & "' and 品种 = '" & comboPinZhongDingWei.Text & "' and 存放位置 = '" & ComboPostion.Text & "'"
If rs.EOF Then
MsgBox "仓库中无此类产品!", , "提示"
rs.Close
cn.Close
Exit Sub
End If
If rs!件数 < Val(txtCount.Text) Then
MsgBox "仓库中此种产品余量不足,件数为" & Str(rs!件数)
rs.Close
cn.Close
Exit Sub
Else
rs!件数 = rs!件数 - Val(txtCount.Text)
End If
rs.Update
rs.Close
cn.Close
Case "棒材":
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockPessimistic
rs.CursorType = adOpenKeyset
rs.Open "select * from 棒库存表 where 存放位置 = '" & ComboPostion.Text & "' and 直径 = '" & comboZhiJingBang.Text & "' and 颜色 = '" & ComboColorBang.Text & "' and 单位米数 = '" & txtDanWeiMiShuBang.Text & "'"
If rs.EOF Then
MsgBox "仓库中无此类产品!", , "提示"
rs.Close
cn.Close
Exit Sub
End If
If rs!件数 < Val(txtCount.Text) Then
MsgBox "仓库中此种产品余量不足,件数为" & Str(rs!数量)
rs.Close
cn.Close
Exit Sub
Else
rs!件数 = rs!件数 - Val(txtCount.Text)
End If
rs.Update
rs.Close
cn.Close
Case "管材":
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockPessimistic
rs.CursorType = adOpenKeyset
rs.Open "select * from 管库存表 where 存放位置 = '" & ComboPostion.Text & "' and 内径 = '" & ComboNeiJingGuan.Text & "' and 外径 = '" & ComboWaiJingGuan.Text & "' and 颜色 = '" & ComboColorGuan.Text & "' and 单位米数 = '" & txtDanWeiMiShuGuan.Text & "'"
If rs.EOF Then
MsgBox "仓库中无此类产品!", , "提示"
rs.Close
cn.Close
Exit Sub
End If
If rs!件数 < Val(txtCount.Text) Then
MsgBox "仓库中此种产品余量不足,件数为" & Str(rs!件数)
rs.Close
cn.Close
Exit Sub
Else
rs!件数 = rs!件数 - Val(txtCount.Text)
End If
rs.Update
rs.Close
cn.Close
Case "网材":
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockPessimistic
rs.CursorType = adOpenKeyset
rs.Open "select * from 网库存表 where 存放位置 = '" & ComboPostion.Text & "' and 颜色 = '" & ComboColorWang.Text & "'"
If rs.EOF Then
MsgBox "仓库中无此类产品!", , "提示"
rs.Close
cn.Close
Exit Sub
End If
If rs!件数 < Val(txtCount.Text) Then
MsgBox "仓库中此种产品余量不足,件数为" & Str(rs!件数)
rs.Close
cn.Close
Exit Sub
Else
rs!件数 = rs!件数 - Val(txtCount.Text)
End If
rs.Update
rs.Close
cn.Close
Case "深加工制品":
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockPessimistic
rs.CursorType = adOpenKeyset
rs.Open "select * from 深加工制品库存表 where 长度 = '" & ComboLangthShenJiaGong.Text & "' and 宽度 = '" & ComboWidthShenJiaGong.Text & "' and 厚度 = '" & ComboHouDuShenJiaGong.Text & "' and 颜色 = '" & ComboColorShenJiaGong.Text & "' and 存放位置 = '" & ComboPostion.Text & "'"
If rs.EOF Then
MsgBox "仓库中无此类产品!", , "提示"
rs.Close
cn.Close
Exit Sub
End If
If rs!件数 < Val(txtCount.Text) Then
MsgBox "仓库中此种产品余量不足,件数为" & Str(rs!件数)
rs.Close
cn.Close
Exit Sub
Else
rs!件数 = rs!件数 - Val(txtCount.Text)
End If
rs.Update
rs.Close
cn.Close
Case "其它":
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockPessimistic
rs.CursorType = adOpenKeyset
rs.Open "select * from 其它产品库存表 where 名称 = '" & ComboProductNameOther.Text & "' and 存放位置 = '" & ComboPostion.Text & "'"
If rs.EOF Then
MsgBox "仓库中无此类产品!", , "提示"
rs.Close
cn.Close
Exit Sub
End If
If rs!件数 < Val(txtWeight.Text) Then
MsgBox "仓库中此种产品余量不足,件数为" & Str(rs!件数)
rs.Close
cn.Close
Exit Sub
Else
rs!件数 = rs!件数 - Val(txtCount.Text)
End If
rs.Update
rs.Close
cn.Close
End Select
'2.更新产品出库记录表
' 记录内容有:产品类型、数量、原存放位置、
' 经办人、日期、产品说明、用车信息、备注信息
' 其中产品说明的内容因产品的类型不同而不同,它是该产品的规格等信息。
Dim strShuoMing As String '用来记录所选产品的产品说明
Select Case ComboProductClass.Text
Case "单片":
strShuoMing = comboLangthDanPian.Text _
& "X" & ComboWidthDanPian.Text _
& "X" & ComboHouDuDanPian.Text _
& ";" & Left(ComboColorDanPian.Text, 1)
Case "复合片":
strShuoMing = ComboLangthFuHe.Text _
& "X" & ComboWidthFuHe.Text _
& "X" & ComboHouDuFuHe.Text _
& ";层数:" & txtCengShuFuhe.Text _
& ";" & Left(ComboColorFuHe.Text, 1)
Case "轧花片":
strShuoMing = ComboLangthYaHua.Text _
& "X" & ComboWidthYaHua.Text _
& "X" & ComboHouDuYaHua.Text _
& "X" & ComboMoHouYaHua.Text _
& Left(ComboColorYaHua.Text, 1) _
& "," & IIf((chkDanShuangMian.Value = 1), "双面", "单面")
Case "淋膜制品":
strShuoMing = ComboLangthLinMo.Text & "X" & _
ComboWidthLinMo.Text & "X" _
& Left(comboColorLinMo.Text, 1) _
& ",1:" & ComboFirstName.Text _
& "," & ComboFirstHouDu.Text _
& ",2:" & ComboSecondName.Text _
& "," & ComboSecondHouDu.Text _
& ",3:" & ComboThirdName.Text _
& "," & ComboThirdHouDu.Text
Case "定位包装":
strShuoMing = comboChangJiaDingWei.Text _
& " " & comboPinZhongDingWei.Text
Case "棒材":
strShuoMing = comboZhiJingBang.Text _
& Left(ComboColorBang.Text, 1) _
& "总长:" & txtZongMiShuBang.Text
Case "管材":
strShuoMing = ComboNeiJingGuan.Text _
& "X" & ComboWaiJingGuan.Text _
& Left(ComboColorGuan.Text, 1) _
& "总长:" & txtZongMiShuGuan.Text
Case "网材":
strShuoMing = Left(ComboColorWang.Text, 1)
Case "深加工制品":
strShuoMing = ComboLangthShenJiaGong.Text _
& "X" & ComboWidthShenJiaGong.Text _
& "X" & ComboHouDuShenJiaGong.Text _
& Left(ComboColorShenJiaGong.Text, 1)
Case "其它":
strShuoMing = ComboProductNameOther.Text
End Select
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockOptimistic
rs.CursorType = adOpenKeyset
rs.Open "产品出库记录表"
rs.AddNew
rs!产品类型 = ComboProductClass.Text
rs!原存放位置 = ComboPostion.Text
rs!件数 = txtCount.Text
rs!数量 = txtWeight.Text
rs!经办人 = lblPerson.Caption
rs!日期 = Date
rs!产品说明 = strShuoMing
rs!备注信息 = txtBeiZhu.Text
rs!用车信息 = txtYongChe.Text
rs.Update
rs.Close
cn.Close
initCanShuControlors
ComboPostion.Text = ""
txtCount.Text = ""
ComboProductClass.Text = ""
txtWeight.Text = ""
txtYongChe.Text = ""
txtBeiZhu.Text = ""
SetDataGrid
End Sub
Private Sub ComboPostion_Click()
txtCount.SetFocus
End Sub
Private Sub ComboProductClass_Click()
Dim i As Integer
For i = 0 To 9
FrameProduct(i).Visible = False
Next i
FrameProduct(ComboProductClass.ListIndex).Visible = True
Select Case ComboProductClass.Text
Case "单片":
'设置单片规格参数
setGuiGeList comboLangthDanPian, "单片", "长度"
setGuiGeList ComboWidthDanPian, "单片", "宽度"
setGuiGeList ComboHouDuDanPian, "单片", "厚度"
setGuiGeList ComboColorDanPian, "单片", "颜色"
Case "复合片":
'设置复合片规格参数
setGuiGeList ComboLangthFuHe, "复合片", "长度"
setGuiGeList ComboWidthFuHe, "复合片", "宽度"
setGuiGeList ComboHouDuFuHe, "复合片", "厚度"
setGuiGeList ComboColorFuHe, "复合片", "颜色"
Case "轧花片":
'设置轧花片规格参数
setGuiGeList ComboLangthYaHua, "轧花片", "长度"
setGuiGeList ComboWidthYaHua, "轧花片", "宽度"
setGuiGeList ComboHouDuYaHua, "轧花片", "厚度"
setGuiGeList ComboColorYaHua, "轧花片", "颜色"
setGuiGeList ComboMoHouYaHua, "轧花片", "膜厚"
Case "淋膜制品":
'设置淋膜制品规格参数
setGuiGeList ComboLangthLinMo, "淋膜制品", "长度"
setGuiGeList ComboWidthLinMo, "淋膜制品", "宽度"
setGuiGeList comboColorLinMo, "淋膜制品", "颜色"
setGuiGeList ComboFirstName, "淋膜制品", "各层名称"
setGuiGeList ComboSecondName, "淋膜制品", "各层名称"
setGuiGeList ComboThirdName, "淋膜制品", "各层名称"
setGuiGeList ComboFirstHouDu, "淋膜制品", "厚度"
setGuiGeList ComboSecondHouDu, "淋膜制品", "厚度"
setGuiGeList ComboThirdHouDu, "淋膜制品", "厚度"
Case "定位包装":
'设置定位包装规格参数
setGuiGeList comboChangJiaDingWei, "定位包装", "厂家"
setGuiGeList comboPinZhongDingWei, "定位包装", "品种"
Case "棒材":
'设置棒材规格参数
setGuiGeList ComboColorBang, "棒材", "颜色"
setGuiGeList comboZhiJingBang, "棒材", "外径"
Case "管材":
'设置管材规格参数
setGuiGeList ComboColorGuan, "管材", "颜色"
setGuiGeList ComboNeiJingGuan, "管材", "内径"
setGuiGeList ComboWaiJingGuan, "管材", "外径"
Case "网材":
'设置网材规格参数
setGuiGeList ComboColorWang, "网材", "颜色"
Case "深加工制品":
'设置深加工制品规格参数
setGuiGeList ComboLangthShenJiaGong, "深加工制品", "长度"
setGuiGeList ComboWidthShenJiaGong, "深加工制品", "宽度"
setGuiGeList ComboHouDuShenJiaGong, "深加工制品", "厚度"
setGuiGeList ComboColorShenJiaGong, "深加工制品", "颜色"
Case "其它":
'设置其它产品规格参数
setGuiGeList ComboProductNameOther, "其它产品", "产品名称"
End Select
ComboPostion.SetFocus
End Sub
Private Sub Form_Load()
lblPerson.Caption = userXingMing
Dim i As Integer
For i = 0 To 9
FrameProduct(i).Visible = False
Next i
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockReadOnly
rs.CursorType = adOpenForwardOnly
rs.Open "存放位置表"
Do Until rs.EOF
ComboPostion.AddItem rs!存放位置
rs.MoveNext
Loop
rs.Close
cn.Close
SetDataGrid
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -