此主题相关图片如下:吨取值.png

想要表B MTType 有变动时,Quantity 按 job_id 和 MTType 去表A取数 先谢谢啦
If e.DataCol.Name = "MTType" Then
If e.NewValue = GrossMT Then
e.DataRow("Quantity") = DataTables("表A").Compute("Sum(GrossMT)", "[Job_id] = '" & e.NewValue & "'")
Else e.NewValue = NetMT Then
e.DataRow("Quantity") = DataTables("表A").Compute("Sum(NetMT)", "[Job_id] = '" & e.NewValue & "'")
End If
End If
[此贴子已经被作者于2023/6/28 11:55:48编辑过]