以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 计数更改为求和 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=131706) |
-- 作者:有点蓝 -- 发布时间:2019/3/4 21:57:00 -- dim sum as integer For Each f As Row In Tables("包装箱需求明细_发货明细").GetCheckedRowsDim s2 As DataRow = w.DataTable.Find("材料编码=\'" & f("材料编码") & "\' and 材料描述 =\'" & f("材料描述") & "\'") If s2 Is Nothing Then s2 = w.DataTable.addnew s2("材料编码") = f("材料编码") s2("材料描述") = f("材料描述") s2("下达日期") = Date.Today s2("规格型号") = f("规格型号") s2("包装箱尺寸") = f("包装箱尺寸") sum = sum +1 s2("需求数量") =sum
End If Next |
-- 作者:有点蓝 -- 发布时间:2019/3/4 22:33:00 -- For Each f As Row In Tables("包装箱需求明细_发货明细").GetCheckedRows Dim s2 As DataRow = w.DataTable.Find("材料编码=\'" & f("材料编码") & "\' and 材料描述 =\'" & f("材料描述") & "\'") If s2 Is Nothing Then s2 = w.DataTable.addnew s2("材料编码") = f("材料编码") s2("材料描述") = f("材料描述") s2("下达日期") = Date.Today s2("规格型号") = f("规格型号") s2("包装箱尺寸") = f("包装箱尺寸") s2("需求数量") =w.compute("sum(需求数量)","材料编码=\'" & f("材料编码") & "\' and 材料描述 =\'" & f("材料描述") & "\'") End If Next |
-- 作者:有点甜 -- 发布时间:2019/3/5 9:17:00 -- 改成
For Each f As Row In Tables("包装箱需求明细_发货明细").GetCheckedRows s2("需求数量") =w.compute("sum(需求数量)","材料编码=\'" & f("材料编码") & "\' and 材料描述 =\'" & f("材料描述") & "\'") |
-- 作者:有点甜 -- 发布时间:2019/3/5 10:40:00 -- Forms("信息录入").Open() Dim w As Table = Forms("信息录入").Controls("信息总表").Table For Each f As Row In Tables("过程明细_明细").GetCheckedRows Dim s2 As DataRow = w.DataTable.Find("成品编码=\'" & f("成品编码") & "\' and 加工工序 =\'" & f("加工工序") & "\'") If s2 Is Nothing Then s2 = w.DataTable.addnew s2("成品编码") = f("成品编码") s2("成品描述") = f("成品描述") s2("日期") = Date.Today End If s2("异常数量") = f.Table.compute("sum(异常数量)","成品编码 =\'" & f("成品编码") & "\' and 加工工序 =\'" & f("加工工序") & "\'") Next |
-- 作者:有点甜 -- 发布时间:2019/3/5 12:18:00 -- Forms("信息录入").Open() |