⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmodifyproduct.frm

📁 this is my first software.
💻 FRM
📖 第 1 页 / 共 3 页
字号:
            txtText.Text = AdodcArg.Recordset!规格值
        ElseIf optOtherProduct.Value = True Then
            txtMeteralName.Text = AdodcArg.Recordset!规格值
        ElseIf optOtherMeteral.Value = True Then
            txtMeteralName.Text = AdodcArg.Recordset!规格值
        End If
    End If
    GuiGeValue = AdodcArg.Recordset!规格值
    cmdDel.Caption = "取消"
    cmdEdit.Enabled = False
    cmdAdd.Caption = "保存"
    cmdDel.Caption = "取消"
    editmode = True
End Sub


Private Sub AdodcArg_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
    If AdodcArg.Recordset.BOF Or AdodcArg.Recordset.EOF Then
        AdodcArg.Caption = "记录:0"
    Else
        AdodcArg.Caption = "记录:" & (AdodcArg.Recordset.AbsolutePosition)
    End If
End Sub


Private Sub Form_Load()
    optSingle.Value = True
End Sub



Private Sub optBang_Click()
    '外径、颜色
    ResetCanShuOpts
    ResetControlors
    optColor.Enabled = True
    optWaiJing.Enabled = True
End Sub

Private Sub optCaiYin_Click()
    '长度、宽度、厚度、颜色、所印文字
    ResetCanShuOpts
    ResetControlors
    optLangth.Enabled = True
    optWidth.Enabled = True
    optHouDu.Enabled = True
    optColor.Enabled = True
    optText.Enabled = True
End Sub

Private Sub optChangJia_Click()
    ResetControlors
    lblChangJia.Enabled = True
    txtChangJia.Enabled = True
    SetDataGrid
End Sub

Private Sub optColor_Click()
    ResetControlors
    lblColor.Enabled = True
    txtColor.Enabled = True
    SetDataGrid
End Sub

Private Sub optDingWei_Click()
    '厂家、品种、颜色
    ResetCanShuOpts
    ResetControlors
    optColor.Enabled = True
    optChangJia.Enabled = True
    optPinZhong.Enabled = True
End Sub

Private Sub optDiYa_Click()
    '长度、宽度、厚度、颜色
    ResetCanShuOpts
    ResetControlors
    optLangth.Enabled = True
    optWidth.Enabled = True
    optHouDu.Enabled = True
    optColor.Enabled = True
    
End Sub

Private Sub optFuHe_Click()
    '只是使参数控件:长度、宽度、厚度、颜色四个有效
    ResetCanShuOpts
    ResetControlors
    optLangth.Enabled = True
    optWidth.Enabled = True
    optHouDu.Enabled = True
    optColor.Enabled = True
End Sub

Private Sub optGaoYa_Click()
    '长度、宽度、厚度、颜色
    ResetCanShuOpts
    ResetControlors
    optLangth.Enabled = True
    optWidth.Enabled = True
    optHouDu.Enabled = True
    optColor.Enabled = True
End Sub

Private Sub optGuan_Click()
    '内径、外径、颜色
    ResetCanShuOpts
    ResetControlors
    optColor.Enabled = True
    optNeiJing.Enabled = True
    optWaiJing.Enabled = True
End Sub

Private Sub optHouDu_Click()
    ResetControlors
    lblHouDu.Enabled = True
    txtHouDu.Enabled = True
    SetDataGrid
End Sub
Private Function ProductName() As String
    If optSingle.Value = True Then
        ProductName = "单片"
    ElseIf optFuHe.Value = True Then
        ProductName = "复合片"
    ElseIf optYaHua.Value = True Then
        ProductName = "轧花片"
    ElseIf optLinMo.Value = True Then
        ProductName = "淋膜制品"
    ElseIf optShenJiaGong.Value = True Then
        ProductName = "深加工制品"
    ElseIf optDingWei.Value = True Then
        ProductName = "定位包装"
    ElseIf optBang.Value = True Then
        ProductName = "棒材"
    ElseIf optGuan.Value = True Then
        ProductName = "管材"
    ElseIf optWang.Value = True Then
        ProductName = "网材"
    ElseIf optOtherProduct.Value = True Then
        ProductName = "其它产品"
    ElseIf optDiYa.Value = True Then
        ProductName = optDiYa.Caption
    ElseIf optGaoYa.Value = True Then
        ProductName = optGaoYa.Caption
    ElseIf optCaiYin.Value = True Then
        ProductName = optCaiYin.Caption
    ElseIf optZhiGuan.Value = True Then
        ProductName = optZhiGuan.Caption
    ElseIf optOtherMeteral.Value = True Then
        ProductName = "其它原料"
    End If
    
End Function
Private Function GuiGeName() As String
    If optLangth.Value = True Then
        GuiGeName = optLangth.Caption
    ElseIf optWidth.Value = True Then
        GuiGeName = optWidth.Caption
    ElseIf optHouDu.Value = True Then
        GuiGeName = optHouDu.Caption
    ElseIf optMoHou.Value = True Then
        GuiGeName = optMoHou.Caption
    ElseIf optColor.Value = True Then
        GuiGeName = optColor.Caption
    ElseIf optChangJia.Value = True Then
        GuiGeName = optChangJia.Caption
    ElseIf optPinZhong.Value = True Then
        GuiGeName = optPinZhong.Caption
    ElseIf optNeiJing.Value = True Then
        GuiGeName = optNeiJing.Caption
    ElseIf optWaiJing.Value = True Then
        GuiGeName = optWaiJing.Caption
    ElseIf optText.Value = True Then
        GuiGeName = optText.Caption
    ElseIf optOtherMeteral.Value = True Then
        GuiGeName = "原料名称"
    ElseIf optOtherProduct.Value = True Then
        GuiGeName = "产品名称"
    End If
End Function
Private Sub ResetCanShuOpts()
    optMoHou.Caption = "膜厚"
    lblMoHou.Caption = "膜厚"
    lblMeteralName.Caption = "原料名称"
    
    optLangth.Value = False
    optWidth.Value = False
    optHouDu.Value = False
    optMoHou.Value = False
    optColor.Value = False
    optChangJia.Value = False
    optPinZhong.Value = False
    optNeiJing.Value = False
    optWaiJing.Value = False
    optText.Value = False
    optLangth.Enabled = False
    optWidth.Enabled = False
    optHouDu.Enabled = False
    optMoHou.Enabled = False
    optColor.Enabled = False
    optChangJia.Enabled = False
    optPinZhong.Enabled = False
    optNeiJing.Enabled = False
    optWaiJing.Enabled = False
    
    optText.Enabled = False
    
    cmdAdd.Enabled = False
    cmdEdit.Enabled = False
    cmdDel.Enabled = False
End Sub
Private Sub optLangth_Click()
    ResetControlors
    lblLangth.Enabled = True
    txtLangth.Enabled = True
    SetDataGrid
End Sub
Private Sub SetDataGrid()
    AdodcArg.ConnectionString = connectString
    AdodcArg.RecordSource = "select 规格值 from 规格表 where 名称 = '" & ProductName & "' and 规格名称 = '" & GuiGeName & "' order by 规格值 ASC"
    Set DataGridArg.DataSource = AdodcArg
    AdodcArg.Refresh
    DataGridArg.Columns(0).Width = 1500

End Sub

Private Sub optLinMo_Click()
    ResetCanShuOpts
    ResetControlors
    '使膜厚参数的名称改为“各层名称”
    optMoHou.Caption = "各层名称"
    lblMoHou.Caption = "各层名称"
    
    '使参数控件:长度、各层名称、宽度、厚度、颜色五个有效
    optLangth.Enabled = True
    optMoHou.Enabled = True
    optWidth.Enabled = True
    optHouDu.Enabled = True
    optColor.Enabled = True
    
End Sub

Private Sub optMoHou_Click()
    ResetControlors
    lblMoHou.Enabled = True
    txtMoHou.Enabled = True
    SetDataGrid
End Sub

Private Sub optNeiJing_Click()
    ResetControlors
    lblNeiJing.Enabled = True
    txtNeiJing.Enabled = True
    SetDataGrid
End Sub

Private Sub optOtherMeteral_Click()
    ResetCanShuOpts
    ResetControlors
    lblMeteralName.Enabled = True
    txtMeteralName.Enabled = True
    SetDataGrid
End Sub

Private Sub optOtherProduct_Click()
    ResetCanShuOpts
    ResetControlors
    lblMeteralName.Caption = "产品名称"
    lblMeteralName.Enabled = True
    txtMeteralName.Enabled = True
    SetDataGrid

End Sub

Private Sub optPinZhong_Click()
    ResetControlors
    lblPinZhong.Enabled = True
    txtPinZhong.Enabled = True
    SetDataGrid
End Sub

Private Sub optShenJiaGong_Click()
    ResetCanShuOpts
    ResetControlors
    optLangth.Enabled = True
    optWidth.Enabled = True
    optHouDu.Enabled = True
    optColor.Enabled = True
End Sub

Private Sub optSingle_Click()
    '只是使参数控件:长度、宽度、厚度、颜色四个有效
    ResetCanShuOpts
    ResetControlors
    optLangth.Enabled = True
    optWidth.Enabled = True
    optHouDu.Enabled = True
    optColor.Enabled = True
    
End Sub
Private Sub ResetControlors()
    '使规格参数的输入框清空并置为无效
    lblLangth.Enabled = False
    txtLangth.Enabled = False
    txtLangth.Text = ""
    lblWidth.Enabled = False
    txtWidth.Enabled = False
    txtWidth.Text = ""
    lblHouDu.Enabled = False
    txtHouDu.Enabled = False
    txtHouDu.Text = ""
    lblMoHou.Enabled = False
    txtMoHou.Enabled = False
    txtMoHou.Text = ""
    lblColor.Enabled = False
    txtColor.Enabled = False
    txtColor.Text = ""
    lblChangJia.Enabled = False
    txtChangJia.Enabled = False
    txtChangJia.Text = ""
    lblPinZhong.Enabled = False
    txtPinZhong.Enabled = False
    txtPinZhong.Text = ""
    lblNeiJing.Enabled = False
    txtNeiJing.Enabled = False
    txtNeiJing.Text = ""
    lblWaiJing.Enabled = False
    txtWaiJing.Enabled = False
    txtWaiJing.Text = ""
    
    lblText.Enabled = False
    txtText.Enabled = False
    txtText.Text = ""
    lblMeteralName.Enabled = False
    txtMeteralName.Enabled = False
    txtMeteralName.Text = ""
    
    cmdAdd.Enabled = True
    cmdEdit.Enabled = True
    cmdDel.Enabled = True
    
End Sub

Private Sub optText_Click()
    ResetControlors
    lblText.Enabled = True
    txtText.Enabled = True
    SetDataGrid
End Sub

Private Sub optWaiJing_Click()
    ResetControlors
    lblWaiJing.Enabled = True
    txtWaiJing.Enabled = True
    SetDataGrid
End Sub

Private Sub optWang_Click()
    '颜色
    ResetCanShuOpts
    ResetControlors
    optColor.Enabled = True
End Sub

Private Sub optWidth_Click()
    ResetControlors
    lblWidth.Enabled = True
    txtWidth.Enabled = True
    SetDataGrid
End Sub

Private Sub optYaHua_Click()
    '只是使参数控件:长度、宽度、膜厚、厚度、颜色五个有效
    
    ResetCanShuOpts
    ResetControlors
    optLangth.Enabled = True
    optWidth.Enabled = True
    optHouDu.Enabled = True
    optMoHou.Enabled = True
    optColor.Enabled = True
End Sub


Private Sub optZhiGuan_Click()
    '长度
    ResetCanShuOpts
    ResetControlors
    optLangth.Enabled = True
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -