📄 frmstorequery.frm
字号:
SQL = "select 长度,宽度,厚度,颜色,所印文字,数量 from 彩印膜库存表 where 数量 > 0"
If ComboLangthCaiYin.Text <> "" Then
SQL = SQL & " and 长度 = '" & ComboLangthCaiYin.Text & "'"
End If
If ComboWidthCaiYin.Text <> "" Then
SQL = SQL & " and 宽度 = '" & ComboWidthCaiYin.Text & "'"
End If
If ComboHouDuCaiYin.Text <> "" Then
SQL = SQL & " and 厚度 = '" & ComboHouDuCaiYin.Text & "'"
End If
If ComboColorCaiYin.Text <> "" Then
SQL = SQL & " and 颜色 = '" & ComboColorCaiYin.Text & "'"
End If
If ComboTextCaiYin.Text <> "" Then
SQL = SQL & " and 所印文字 = '" & ComboTextCaiYin.Text & "'"
End If
Case "纸管":
SQL = "select 长度,数量 from 纸管库存表 where 数量 > 0"
If ComboLangthZhiGuan.Text <> "" Then
SQL = SQL & " and 长度 = '" & ComboLangthZhiGuan.Text & "'"
End If
Case Else:
SQL = "select 名称,数量 from 其它原料库存表 where 名称 = '" & ComboMeteral.Text & "' and 数量 > 0"
End Select
SetDataGrid
End Sub
Private Sub cmdModifyBeiZhu_Click()
If cmdModifyBeiZhu.Caption = "修改备注信息" Then
If AdodcArg.Recordset.EOF Or AdodcArg.Recordset.BOF Then
MsgBox "当前记录为空,不允许修改!", , "提示"
Exit Sub
End If
txtBeiZhu.Text = AdodcArg.Recordset!备注信息
cmdModifyBeiZhu.Caption = "保存"
Else
If txtBeiZhu.Text = "" Then
txtBeiZhu.Text = " "
End If
AdodcArg.Recordset!备注信息 = txtBeiZhu.Text
txtBeiZhu.Text = ""
cmdModifyBeiZhu.Caption = "修改备注信息"
End If
End Sub
Private Sub cmdProductQuery_Click()
'如果只根据存放位置进行查询,则无法给出完整的信息。
'只能显示产品类型,总的件数,所有没有多大意义。
If ComboProductClass.Text = "" Then
MsgBox "请选择产品类型!", , "提示"
Exit Sub
End If
Select Case ComboProductClass.Text
Case "单片":
SQL = "select 长度,宽度,厚度,颜色,纸芯,存放位置,件数,备注信息 from 单片库存表 where 件数 > 0"
If ComboPostion.Text <> "" Then
SQL = SQL & " and 存放位置 = '" & ComboPostion.Text & "'"
End If
If comboLangthDanPian.Text <> "" Then
SQL = SQL & " and 长度 = '" & comboLangthDanPian.Text & "'"
End If
If ComboWidthDanPian.Text <> "" Then
SQL = SQL & " and 宽度 = '" & ComboWidthDanPian.Text & "'"
End If
If ComboHouDuDanPian.Text <> "" Then
SQL = SQL & " and 厚度 = '" & ComboHouDuDanPian.Text & "'"
End If
If ComboColorDanPian.Text <> "" Then
SQL = SQL & " and 颜色 = '" & ComboColorDanPian.Text & "'"
End If
If chkYouZhiXinDanPian.Value = 0 Then
SQL = SQL & " and 纸芯 = false"
Else
SQL = SQL & " and 纸芯 = true"
End If
Case "复合片":
SQL = "select 长度,宽度,厚度,层数,颜色,纸芯,存放位置,件数,备注信息 from 复合片库存表 where 件数 > 0"
If ComboPostion.Text <> "" Then
SQL = SQL & " and 存放位置 = '" & ComboPostion.Text & "'"
End If
If ComboLangthFuHe.Text <> "" Then
SQL = SQL & " and 长度 = '" & ComboLangthFuHe.Text & "'"
End If
If ComboWidthFuHe.Text <> "" Then
SQL = SQL & " and 宽度 = '" & ComboWidthFuHe.Text & "'"
End If
If ComboHouDuFuHe.Text <> "" Then
SQL = SQL & " and 厚度 = '" & ComboHouDuFuHe.Text & "'"
End If
If txtCengShuFuHe.Text <> "" Then
SQL = SQL & " and 层数 = '" & txtCengShuFuHe.Text & "'"
End If
If ComboColorFuHe.Text <> "" Then
SQL = SQL & " and 颜色 = '" & ComboColorFuHe.Text & "'"
End If
If chkYouZhiXinFuHe.Value = 0 Then
SQL = SQL & " and 纸芯 = false"
Else
SQL = SQL & " and 纸芯 = true"
End If
Case "轧花片":
SQL = "select 长度,宽度,厚度,膜厚,单双面,颜色,纸芯,存放位置,件数,备注信息 from 轧花片库存表 where 件数 > 0"
If ComboPostion.Text <> "" Then
SQL = SQL & " and 存放位置 = '" & ComboPostion.Text & "'"
End If
If ComboLangthYaHua.Text <> "" Then
SQL = SQL & " and 长度 = '" & ComboLangthYaHua.Text & "'"
End If
If ComboWidthYaHua.Text <> "" Then
SQL = SQL & " and 宽度 = '" & ComboWidthYaHua.Text & "'"
End If
If ComboHouDuYaHua.Text <> "" Then
SQL = SQL & " and 厚度 = '" & ComboHouDuYaHua.Text & "'"
End If
If ComboMoHouYaHua.Text <> "" Then
SQL = SQL & " and 膜厚 = '" & ComboMoHouYaHua.Text & "'"
End If
If chkDanShuangMian.Value = 0 Then
SQL = SQL & " and 单双面 = false"
Else
SQL = SQL & " and 单双面 = true"
End If
If ComboColorYaHua.Text <> "" Then
SQL = SQL & " and 颜色 = '" & ComboColorYaHua.Text & "'"
End If
If chkYouZhiXinYaHua.Value = 0 Then
SQL = SQL & " and 纸芯 = false"
Else
SQL = SQL & " and 纸芯 = true"
End If
Case "淋膜制品":
SQL = "select 长度,宽度,颜色,第一层名称,第一层厚度,第二层名称,第二层厚度,第三层名称,第三层厚度,存放位置,件数,备注信息 from 淋膜制品库存表 where 件数 > 0"
If ComboPostion.Text <> "" Then
SQL = SQL & " and 存放位置 = '" & ComboPostion.Text & "'"
End If
If ComboLangthLinMo.Text <> "" Then
SQL = SQL & " and 长度 = '" & ComboLangthLinMo.Text & "'"
End If
If ComboWidthLinMo.Text <> "" Then
SQL = SQL & " and 宽度 = '" & ComboWidthLinMo.Text & "'"
End If
If ComboFirstName.Text <> "" Then
SQL = SQL & " and 第一层名称 = '" & ComboFirstName.Text & "'"
End If
If ComboFirstHouDu.Text <> "" Then
SQL = SQL & " and 第一层厚度 = '" & ComboFirstHouDu.Text & "'"
End If
If ComboSecondName.Text <> "" Then
SQL = SQL & " and 第二层名称 = '" & ComboSecondName.Text & "'"
End If
If ComboSecondHouDu.Text <> "" Then
SQL = SQL & " and 第二层厚度 = '" & ComboSecondHouDu.Text & "'"
End If
If ComboThirdName.Text <> "" Then
SQL = SQL & " and 第三层名称 = '" & ComboThirdName.Text & "'"
End If
If ComboThirdHouDu.Text <> "" Then
SQL = SQL & " and 第三层厚度 = '" & ComboThirdHouDu.Text & "'"
End If
Case "定位包装":
SQL = "select 厂家,品种,存放位置,件数,备注信息 from 定位包装库存表 where 件数 > 0"
If ComboPostion.Text <> "" Then
SQL = SQL & " and 存放位置 = '" & ComboPostion.Text & "'"
End If
If comboChangJiaDingWei.Text <> "" Then
SQL = SQL & " and 厂家 = '" & comboChangJiaDingWei.Text & "'"
End If
If comboPinZhongDingWei.Text <> "" Then
SQL = SQL & " and 品种 = '" & comboPinZhongDingWei.Text & "'"
End If
Case "棒材":
SQL = "select 直径,颜色,单位米数,存放位置,件数,备注信息 from 棒库存表 where 件数 > 0"
If ComboPostion.Text <> "" Then
SQL = SQL & " and 存放位置 = '" & ComboPostion.Text & "'"
End If
If comboZhiJingBang.Text <> "" Then
SQL = SQL & " and 直径 = '" & comboZhiJingBang.Text & "'"
End If
If ComboColorBang.Text <> "" Then
SQL = SQL & " and 颜色 = '" & ComboColorBang.Text & "'"
End If
If txtDanWeiMiShuBang.Text <> "" Then
SQL = SQL & " and 单位米数 = '" & txtDanWeiMiShuBang.Text & "'"
End If
Case "管材":
SQL = "select 内径,外径,颜色,单位米数,存放位置,件数,备注信息 from 管库存表 where 件数 > 0"
If ComboPostion.Text <> "" Then
SQL = SQL & " and 存放位置 = '" & ComboPostion.Text & "'"
End If
If ComboNeiJingGuan.Text <> "" Then
SQL = SQL & " and 内径 = '" & ComboNeiJingGuan.Text & "'"
End If
If ComboWaiJingGuan.Text <> "" Then
SQL = SQL & " and 外径 = '" & ComboWaiJingGuan.Text & "'"
End If
If ComboColorGuan.Text <> "" Then
SQL = SQL & " and 颜色 = '" & ComboColorGuan.Text & "'"
End If
If txtDanWeiMiShuGuan.Text <> "" Then
SQL = SQL & " and 单位米数 = '" & txtDanWeiMiShuGuan.Text & "'"
End If
Case "网材":
SQL = "select 颜色,存放位置,件数,备注信息 from 网库存表 where 件数 > 0"
If ComboPostion.Text <> "" Then
SQL = SQL & " and 存放位置 = '" & ComboPostion.Text & "'"
End If
If ComboColorWang.Text <> "" Then
SQL = SQL & " and 颜色 = '" & ComboColorWang.Text & "'"
End If
Case "深加工制品":
SQL = "select 长度,宽度,厚度,颜色,存放位置,件数,备注信息 from 深加工制品库存表 where 件数 > 0"
If ComboPostion.Text <> "" Then
SQL = SQL & " and 存放位置 = '" & ComboPostion.Text & "'"
End If
If ComboLangthShenJiaGong.Text <> "" Then
SQL = SQL & " and 长度 = '" & ComboLangthShenJiaGong.Text & "'"
End If
If ComboWidthShenJiaGong.Text <> "" Then
SQL = SQL & " and 宽度 = '" & ComboWidthShenJiaGong.Text & "'"
End If
If ComboHouDuShenJiaGong.Text <> "" Then
SQL = SQL & " and 厚度 = '" & ComboHouDuShenJiaGong.Text & "'"
End If
If ComboColorShenJiaGong.Text <> "" Then
SQL = SQL & " and 颜色 = '" & ComboColorShenJiaGong.Text & "'"
End If
Case "其它":
SQL = "select 名称,存放位置,件数,备注信息 from 其它产品库存表 where 件数 > 0"
If ComboPostion.Text <> "" Then
SQL = SQL & " and 存放位置 = '" & ComboPostion.Text & "'"
End If
If ComboProductNameOther.Text <> "" Then
SQL = SQL & " and 名称 = '" & ComboProductNameOther.Text & "'"
End If
End Select
SetDataGrid
cmdModifyBeiZhu.Enabled = True
End Sub
Private Sub ComboMeteral_Click()
Dim i As Integer
For i = 0 To 3
FrameMeteral(i).Visible = False
Next i
If ComboMeteral.ListIndex <= 3 Then
FrameMeteral(ComboMeteral.ListIndex).Visible = True
End If
Select Case ComboMeteral.Text
Case "低压膜":
'设置低压膜规格参数
setGuiGeList ComboLangthDiYa, "低压膜", "长度"
setGuiGeList ComboWidthDiYa, "低压膜", "宽度"
setGuiGeList ComboHouDuDiYa, "低压膜", "厚度"
setGuiGeList ComboColorDiYa, "低压膜", "颜色"
Case "高压膜":
'设置高压膜规格参数
setGuiGeList ComboLangthGaoYa, "高压膜", "长度"
setGuiGeList ComboWidthGaoYa, "高压膜", "宽度"
setGuiGeList ComboHouDuGaoYa, "高压膜", "厚度"
setGuiGeList ComboColorGaoYa, "高压膜", "颜色"
Case "彩印膜":
'设置彩印膜规格参数
setGuiGeList ComboLangthCaiYin, "彩印膜", "长度"
setGuiGeList ComboWidthCaiYin, "彩印膜", "宽度"
setGuiGeList ComboHouDuCaiYin, "彩印膜", "厚度"
setGuiGeList ComboColorCaiYin, "彩印膜", "颜色"
setGuiGeList ComboTextCaiYin, "轧花片", "所印文字"
Case "纸管"
'设置纸管规格参数
setGuiGeList ComboLangthZhiGuan, "纸管", "长度"
End Select
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 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
End Sub
Private Sub Form_Load()
Dim i As Integer
For i = 0 To 9
FrameProduct(i).Visible = False
Next i
For i = 0 To 3
FrameMeteral(i).Visible = False
Next i
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockReadOnly
rs.CursorType = adOpenForwardOnly
rs.Open "select 规格值 from 规格表 where 名称 = '其它原料' and 规格名称 = '原料名称'"
Do Until rs.EOF
ComboMeteral.AddItem rs!规格值
rs.MoveNext
Loop
rs.Close
cn.Close
End Sub
Private Sub mmuMeteral_Click()
ComboMeteral.Enabled = True
cmdMeteralQuery.Enabled = True
cmdProductQuery.Enabled = False
ComboProductClass.Enabled = False
ComboPostion.Enabled = False
End Sub
Private Sub mmuProduct_Click()
ComboProductClass.Enabled = True
ComboPostion.Enabled = True
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockReadOnly
rs.CursorType = adOpenForwardOnly
rs.Open "select 存放位置 from 存放位置表"
Do Until rs.EOF
ComboPostion.AddItem rs!存放位置
rs.MoveNext
Loop
rs.Close
cn.Close
cmdProductQuery.Enabled = True
cmdMeteralQuery.Enabled = False
ComboMeteral.Enabled = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -