你要输入 【产品编码】、【型号】、【日期】,才能查找和计算的,类似 http://www.foxtable.com/webhelp/scr/0681.htm
Select Case e.DataCol.Name
Case "日期", "产品编码", "型号"
If e.DataRow.IsNull("日期") Then
e.DataRow("产品数量")= Nothing
e.DataRow("重量")= Nothing
e.DataRow("PP黑料用量")= Nothing
e.DataRow("PP新料")= Nothing
Else
Dim dr As DataRow = DataTables("产品用料表").Find("产品编码='" & e.DataRow("产品编码") & "' and 型号='" & e.DataRow("型号") & "'")
If dr IsNot Nothing Then
Dim sl As Integer = DataTables("联塑订单表").Compute("Sum(数量)","下单日期='" & e.DataRow("日期") & "' And 产品编码='" & e.DataRow("产品编码") & "' and 型号='" & e.DataRow("型号") & "'")
e.DataRow("产品数量")= sl
e.DataRow("重量")= dr("重量") * sl
e.DataRow("PP黑料用量")= dr("PP黑料用量") * sl
e.DataRow("PP新料")= dr("PP新料") * sl
End If
End If
End Select
[此贴子已经被作者于2018/1/1 20:12:59编辑过]