📄
字号:
Call Tlb_Action_ButtonClick(Me.Tlb_Action.Buttons("xz"))
Me.dbl_RecordAutoCode = Cg_PlanUnitSplit.CxbbGrid.TextMatrix(Cg_PlanUnitSplit.CxbbGrid.Row, 0)
With Cg_PlanUnitSplit.CxbbGrid
Set rs_PlanSearch = Cw_DataEnvi.DataConnect.Execute("select KjYear,Period,MNumber,MName,Model,PurUnitName,Sum(Quantity) as SumQuantity from Cg_V_PlanBill where PurPlanMainID='" & .TextMatrix(.Row, 0) & "' and ProcFactory =''group by MNumber,MName,Model,PurUnitName,KjYear,Period")
WglrGrid.TextMatrix(1, Sydz("001", GridStr(), Szzls)) = Trim(rs_PlanSearch!MNumber) '物料编码
WglrGrid.TextMatrix(1, Sydz("002", GridStr(), Szzls)) = Trim("" & rs_PlanSearch!MName) '物料名称
WglrGrid.TextMatrix(1, Sydz("003", GridStr(), Szzls)) = Trim("" & rs_PlanSearch!Model) '规格型号
WglrGrid.TextMatrix(1, Sydz("004", GridStr(), Szzls)) = Trim("" & rs_PlanSearch!PurUnitName) '计量单位
WglrGrid.TextMatrix(1, 0) = "*"
WglrGrid.RowHeight(WglrGrid.Rows - 1) = Sjhgd
ReDim Material_Num(rs_PlanSearch.RecordCount - 1)
ReDim Material_Str(rs_PlanSearch.RecordCount - 1)
Lng_KjYear = rs_PlanSearch.Fields("KjYear")
Lng_Period = rs_PlanSearch.Fields("Period")
Dim j As Long
plan_material_num = rs_PlanSearch.RecordCount - 1
j = 0
Do While Not rs_PlanSearch.EOF()
Material_Num(j) = S2N(Trim(rs_PlanSearch("SumQuantity")))
Material_Str(j) = Trim(rs_PlanSearch("MNumber"))
rs_PlanSearch.MoveNext
j = j + 1
Loop
End With
WglrGrid.Enabled = True
End Sub
Private Sub Form_Unload(Cancel As Integer) '窗体卸载
'清除查询条件
ReDim Cxckbm(0)
ReDim Cxdjbh(0)
Me.dbl_RecordAutoCode = 0
Cxdjgs = 0
Hqssckbm = ""
Hwsshqbm = ""
'卸载打印页面窗体
Unload Dyymctbl
End Sub
Private Sub Sjcsh(Str_Pzclzt As String) '数据初始化模块(根据实际情况)
'[>>根据实际情况初始化
Select Case Str_Pzclzt
Case "1" '新增记录
'日期默认值为用户选择日期
'设置操作状态为浏览
Lab_OperStatus = "1"
Call Sub_OperStatus("1")
End Select
'<<]
'重 置 网 格
Call Sub_AdjustGrid
End Sub
Private Sub Tlb_Action_ButtonClick(ByVal Button As MSComctlLib.Button) '用户点击工具条
'屏蔽文本框有效性判断
Valilock = True
'屏蔽网格失去焦点产生的有效性判断
Changelock = True
Select Case Button.Key
Case "ymsz" '页面设置
Dyymctbl.Show 1
Case "yl" '预 览
If Fun_Drfrmyxxpd Then Call bbyl(True)
Case "dy" '打 印
If Fun_Drfrmyxxpd Then Call bbyl(False)
Case "xz" '新 增
Call Sub_AddBill
Case "zh" '增 行
Call zjlrfl
Case "sh" '删 行
Call Scdqfl
Case "bc" '保 存
If Fun_Drfrmyxxpd Then Call Sub_SaveBill
Case "fh" '退 出
Unload Me
End Select
'解 锁
Valilock = False
Changelock = False
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) '支持热键操作
With Me.Tlb_Action
Select Case KeyCode
Case vbKeyF5
If .Buttons("xz").Enabled = True And .Buttons("xz").Visible = True Then
Call Tlb_Action_ButtonClick(.Buttons("xz"))
End If
Case vbKeyF6
If .Buttons("bc").Enabled = True And .Buttons("bc").Visible = True Then
Call Tlb_Action_ButtonClick(.Buttons("bc"))
End If
Case vbKeyF3
If .Buttons("xg").Enabled = True And .Buttons("xg").Visible = True Then
Call Tlb_Action_ButtonClick(.Buttons("xg"))
End If
Case 27
If .Buttons("fq").Enabled = True And .Buttons("fq").Visible = True Then
Call Tlb_Action_ButtonClick(.Buttons("fq"))
End If
End Select
End With
End Sub
Private Sub FrmTlbState(int_FrmState As Integer)
With Me.Tlb_Action
Select Case int_FrmState
Case 1 '增加
.Buttons("ymsz").Visible = True
.Buttons("yl").Visible = True
.Buttons("dy").Visible = True
.Buttons("xz").Visible = True
.Buttons("xg").Visible = True
.Buttons("sc").Visible = True
.Buttons("zh").Visible = True
.Buttons("sh").Visible = True
.Buttons("bc").Visible = True
.Buttons("fq").Visible = True
.Buttons("cx").Visible = False
.Buttons("first").Visible = False
.Buttons("next").Visible = False
.Buttons("last").Visible = False
.Buttons("prev").Visible = False
Case 2 '修改
.Buttons("ymsz").Visible = True
.Buttons("yl").Visible = True
.Buttons("dy").Visible = True
.Buttons("xz").Visible = False
.Buttons("xg").Visible = True
.Buttons("sc").Visible = True
.Buttons("zh").Visible = True
.Buttons("sh").Visible = True
.Buttons("bc").Visible = True
.Buttons("fq").Visible = True
.Buttons("first").Visible = True
.Buttons("next").Visible = True
.Buttons("last").Visible = True
.Buttons("prev").Visible = True
.Buttons("bKey5").Visible = True
Case 3 '审核
.Buttons("ymsz").Visible = True
.Buttons("yl").Visible = True
.Buttons("dy").Visible = True
.Buttons("bKey1").Visible = False
.Buttons("bKey2").Visible = False
.Buttons("xz").Visible = False
.Buttons("xg").Visible = False
.Buttons("sc").Visible = False
.Buttons("zh").Visible = False
.Buttons("sh").Visible = False
.Buttons("bc").Visible = False
.Buttons("fq").Visible = False
.Buttons("Check").Visible = True
.Buttons("Uncheck").Visible = True
.Buttons("CheckAll").Visible = True
.Buttons("UncheckAll").Visible = True
.Buttons("sCheck").Visible = True
.Buttons("first").Visible = True
.Buttons("next").Visible = True
.Buttons("last").Visible = True
.Buttons("prev").Visible = True
End Select
End With
End Sub
Private Sub Sub_OperStatus(Str_Status As String) '工具条依据不同状态所进行的变化
With Tlb_Action
Select Case Str_Status
Case "1" '初始化,放弃新增,放弃查询
'工具条]
.Buttons("ymsz").Enabled = True '设置
.Buttons("dy").Enabled = True '打印
.Buttons("yl").Enabled = True '预览
.Buttons("xz").Enabled = True '新增
.Buttons("xg").Enabled = False '修改
.Buttons("sc").Enabled = False '删除
.Buttons("zh").Enabled = False '增行
.Buttons("sh").Enabled = False '删行
.Buttons("bc").Enabled = False '保存
.Buttons("fq").Enabled = False '放弃
.Buttons("cx").Enabled = True '查询
.Buttons("first").Enabled = True '首张
.Buttons("prev").Enabled = True '上张
.Buttons("next").Enabled = True '下张
.Buttons("last").Enabled = True '末张
Case "2" '新增单据
'工具条
.Buttons("ymsz").Enabled = False '设置
.Buttons("dy").Enabled = False '打印
.Buttons("yl").Enabled = False '预览
.Buttons("xz").Enabled = False '新增
.Buttons("xg").Enabled = False '修改
.Buttons("sc").Enabled = False '删除
.Buttons("zh").Enabled = True '增行
.Buttons("sh").Enabled = True '删行
.Buttons("bc").Enabled = True '保存
.Buttons("fq").Enabled = True '放弃
.Buttons("cx").Enabled = False '查询
.Buttons("first").Enabled = False '首张
.Buttons("prev").Enabled = False '上张
.Buttons("next").Enabled = False '下张
.Buttons("last").Enabled = False '末张
'录入文本框
Case "3" '修改
'工具条
.Buttons("ymsz").Enabled = False '设置
.Buttons("dy").Enabled = False '打印
.Buttons("yl").Enabled = False '预览
.Buttons("xz").Enabled = False '新增
.Buttons("xg").Enabled = False '修改
.Buttons("sc").Enabled = False '删除
.Buttons("zh").Enabled = True '增行
.Buttons("sh").Enabled = True '删行
.Buttons("bc").Enabled = True '保存
.Buttons("fq").Enabled = True '放弃
.Buttons("cx").Enabled = False '查询
.Buttons("first").Enabled = False '首张
.Buttons("prev").Enabled = False '上张
.Buttons("next").Enabled = False '下张
.Buttons("last").Enabled = False '末张
Case "4" '查询单据)
'工具条
.Buttons("ymsz").Enabled = True '设置
.Buttons("dy").Enabled = True '打印
.Buttons("yl").Enabled = True '预览
.Buttons("xz").Enabled = False '新增
.Buttons("xg").Enabled = True '修改
.Buttons("sc").Enabled = True '删除
.Buttons("zh").Enabled = False '增行
.Buttons("sh").Enabled = False '删行
.Buttons("bc").Enabled = False '保存
.Buttons("fq").Enabled = True '放弃
.Buttons("cx").Enabled = True '查询
If Cxdjgs > 1 Then
.Buttons("first").Enabled = False '首张
.Buttons("prev").Enabled = False '上张
.Buttons("next").Enabled = True '下张
.Buttons("last").Enabled = True '末张
Else
.Buttons("first").Enabled = False '首张
.Buttons("prev").Enabled = False '上张
.Buttons("next").Enabled = False '下张
.Buttons("last").Enabled = False
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -