生产表datacolchanging事件
If e.DataCol.Name.StartsWith("累计产量") Then
Dim sum1 As Double = DataTables("订单表").compute("sum(" & e.DataCol.name & ")", "款号='" & e.DataRow("款号") & "'")
Dim sum2 As Double = DataTables("生产表").compute("sum(" & e.DataCol.name & ")", "款号='" & e.DataRow("款号") & "'")
If sum2-e.OldValue+e.NewValue > sum1 Then
msgbox("超出订单数")
e.cancel = True
End If
End If