📄 frmproductin.frm
字号:
",3:" & ComboThirdName.Text & _
"," & ComboThirdHouDu.Text & _
";密度" & txtMiDuLinMo.Text
Case "定位包装":
strShuoMing = comboChangJiaDingWei.Text & _
" " & comboPinZhongDingWei.Text _
& ";密度:" & txtMiDuDingWei.Text
Case "棒材":
strShuoMing = comboZhiJingBang.Text _
& ";" & Left(ComboColorBang.Text, 1) _
& ";总长:" & txtZongMiShuBang.Text _
& ";密度:" & txtMiDuBang.Text
Case "管材":
strShuoMing = ComboNeiJingGuan.Text _
& "X" & ComboWaiJingGuan.Text _
& ";" & Left(ComboColorGuan.Text, 1) _
& ";总长:" & txtZongMiShuGuan.Text _
& ";密度:" & txtMiDuGuan.Text
Case "网材":
strShuoMing = Left(ComboColorWang.Text, 1) _
& ";密度:" & txtMiDuWang.Text
Case "深加工制品":
strShuoMing = ComboLangthShenJiaGong.Text _
& "X" & ComboWidthShenJiaGong.Text _
& "X" & ComboHouDuShenJiaGong.Text _
& ";" & Left(ComboColorShenJiaGong.Text, 1) _
& ";密度:" & txtMiDuShenJiaGong.Text
Case "其它":
strShuoMing = ComboProductNameOther.Text _
& ";密度:" & txtMiDuOther.Text
End Select
'以下开始将信息写入产品入库记录表中
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockOptimistic
rs.CursorType = adOpenKeyset
rs.Open "产品入库记录表"
rs.AddNew
rs!产品类型 = ComboProductClass.Text
rs!来源 = ComboSource.Text
rs!班次 = ComboClass.Text
rs!工号 = txtNumber.Text
rs!存放位置 = ComboPostion.Text
rs!件数 = Val(txtCount.Text)
rs!数量 = Val(txtWeight.Text)
rs!经办人 = lblPerson.Caption
rs!日期 = Date
rs!产品说明 = strShuoMing
rs!备注信息 = txtBeiZhu.Text
rs.Update
rs.Close
cn.Close
'2.同步更新库存
Select Case ComboProductClass.Text
Case "单片":
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockPessimistic
rs.CursorType = adOpenKeyset
If chkYouZhiXinDanPian.Value = 1 Then
rs.Open "select * from 单片库存表 where 长度 = '" & comboLangthDanPian.Text & "' and 宽度 = '" & ComboWidthDanPian.Text & "' and 厚度 = '" & ComboHouDuDanPian.Text & "' and 颜色 = '" & ComboColorDanPian.Text & "' and 存放位置 = '" & ComboPostion.Text & "' and 纸芯 = True"
Else
rs.Open "select * from 单片库存表 where 长度 = '" & comboLangthDanPian.Text & "' and 宽度 = '" & ComboWidthDanPian.Text & "' and 厚度 = '" & ComboHouDuDanPian.Text & "' and 颜色 = '" & ComboColorDanPian.Text & "' and 存放位置 = '" & ComboPostion.Text & "' and 纸芯 = false"
End If
If rs.EOF Then
rs.AddNew
rs!长度 = comboLangthDanPian.Text
rs!宽度 = ComboWidthDanPian.Text
rs!厚度 = ComboHouDuDanPian.Text
rs!颜色 = ComboColorDanPian.Text
rs!存放位置 = ComboPostion.Text
rs!备注信息 = txtBeiZhu.Text
rs!件数 = Val(txtCount.Text)
rs!纸芯 = IIf((chkYouZhiXinDanPian.Value = 1), True, False)
Else
rs!件数 = rs!件数 + Val(txtCount.Text)
rs!备注信息 = rs!备注信息 & txtBeiZhu.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
rs.AddNew
rs!长度 = ComboLangthFuHe.Text
rs!宽度 = ComboWidthFuHe.Text
rs!厚度 = ComboHouDuFuHe.Text
rs!颜色 = ComboColorFuHe.Text
rs!存放位置 = ComboPostion.Text
rs!件数 = Val(txtCount.Text)
rs!纸芯 = IIf((chkYouZhiXinFuHe.Value = 1), True, False)
rs!层数 = txtCengShuFuHe.Text
rs!备注信息 = txtBeiZhu.Text
Else
rs!件数 = rs!件数 + Val(txtCount.Text)
rs!备注信息 = rs!备注信息 & txtBeiZhu.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
rs.AddNew
rs!长度 = ComboLangthYaHua.Text
rs!宽度 = ComboWidthYaHua.Text
rs!厚度 = ComboHouDuYaHua.Text
rs!膜厚 = ComboMoHouYaHua.Text
rs!颜色 = ComboColorYaHua.Text
rs!存放位置 = ComboPostion.Text
rs!单双面 = IIf((chkDanShuangMian.Value = 1), True, False)
rs!件数 = Val(txtCount.Text)
rs!纸芯 = IIf((chkYouZhiXinYaHua.Value = 1), True, False)
rs!备注信息 = txtBeiZhu.Text
Else
rs!件数 = rs!件数 + Val(txtCount.Text)
rs!备注信息 = rs!备注信息 & txtBeiZhu.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
rs.AddNew
rs!长度 = ComboLangthLinMo.Text
rs!宽度 = ComboWidthLinMo.Text
rs!颜色 = ComboColorLinMo.Text
rs!第一层名称 = ComboFirstName.Text
rs!第一层厚度 = ComboFirstHouDu.Text
rs!第二层名称 = ComboSecondName.Text
rs!第二层厚度 = ComboSecondHouDu.Text
rs!第三层名称 = ComboThirdName.Text
rs!第三层厚度 = ComboThirdHouDu.Text
rs!存放位置 = ComboPostion.Text
rs!件数 = Val(txtCount.Text)
rs!备注信息 = txtBeiZhu.Text
Else
rs!件数 = rs!件数 + Val(txtCount.Text)
rs!备注信息 = rs!备注信息 & txtBeiZhu.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
rs.AddNew
rs!厂家 = comboChangJiaDingWei.Text
rs!品种 = comboPinZhongDingWei.Text
rs!存放位置 = ComboPostion.Text
rs!件数 = Val(txtCount.Text)
rs!备注信息 = txtBeiZhu.Text
Else
rs!件数 = rs!件数 + Val(txtCount.Text)
rs!备注信息 = rs!备注信息 & txtBeiZhu.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
rs.AddNew
rs!颜色 = ComboColorBang.Text
rs!直径 = comboZhiJingBang.Text
rs!单位米数 = txtDanWeiMiShuBang.Text
rs!件数 = Val(txtCount.Text)
rs!存放位置 = ComboPostion.Text
rs!备注信息 = txtBeiZhu.Text
Else
rs!件数 = rs!件数 + Val(txtCount.Text)
rs!备注信息 = rs!备注信息 & txtBeiZhu.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
rs.AddNew
rs!颜色 = ComboColorGuan.Text
rs!内径 = ComboNeiJingGuan.Text
rs!外径 = ComboWaiJingGuan.Text
rs!单位米数 = txtDanWeiMiShuGuan.Text
rs!件数 = Val(txtCount.Text)
rs!存放位置 = ComboPostion.Text
rs!备注信息 = txtBeiZhu.Text
Else
rs!件数 = rs!件数 + Val(txtCount.Text)
rs!备注信息 = rs!备注信息 & txtBeiZhu.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
rs.AddNew
rs!颜色 = ComboColorWang.Text
rs!件数 = Val(txtCount.Text)
rs!存放位置 = ComboPostion.Text
rs!备注信息 = txtBeiZhu.Text
Else
rs!件数 = rs!件数 + Val(txtCount.Text)
rs!备注信息 = rs!备注信息 & txtBeiZhu.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
rs.AddNew
rs!长度 = ComboLangthShenJiaGong.Text
rs!宽度 = ComboWidthShenJiaGong.Text
rs!厚度 = ComboHouDuShenJiaGong.Text
rs!颜色 = ComboColorShenJiaGong.Text
rs!存放位置 = ComboPostion.Text
rs!件数 = Val(txtCount.Text)
rs!备注信息 = txtBeiZhu.Text
Else
rs!件数 = rs!件数 + Val(txtCount.Text)
rs!备注信息 = rs!备注信息 & txtBeiZhu.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
rs.AddNew
rs!名称 = ComboProductNameOther.Text
rs!件数 = Val(txtCount.Text)
rs!存放位置 = ComboPostion.Text
rs!备注信息 = txtBeiZhu.Text
Else
rs!件数 = rs!件数 + Val(txtCount.Text)
rs!备注信息 = rs!备注信息 & txtBeiZhu.Text
End If
rs.Update
rs.Close
cn.Close
End Select
initCanShuControlors
ComboClass.Text = ""
txtNumber.Text = ""
ComboPostion.Text = ""
txtCount.Text = ""
ComboSource.Text = ""
ComboProductClass.Text = ""
txtWeight.Text = ""
txtBeiZhu.Text = ""
SetDataGrid
End Sub
Private Sub SetDataGrid()
Dim currentDate As String
currentDate = Str(Year(Date)) & "-" & Str(Month(Date)) & "-" & Str(Day(Date))
AdodcArg.ConnectionString = connectString
AdodcArg.RecordSource = "select 产品类型,来源,件数,数量,班次,工号,存放位置,经办人,产品说明,备注信息 from 产品入库记录表 where 日期 = " & "#" & currentDate & "#"
Set DataGridArg.DataSource = AdodcArg
AdodcArg.Refresh
End Sub
Private Sub ComboClass_Click()
txtNumber.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, "淋膜制品", "厚度"
C
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -