有两个表A表和B表,当B表某列的值发生变化时,相关数据返回到A表的相关列。现在使用以下代码遇到一些问题,有些数据可以返回到有些数据返回不到A表相关列。而返回不到的那些,重置列以后也是返回不到。不知什么原因?
If e.DataCol.name = "半成品净重" Then
Dim dr As DataRow = e.DataRow
dr.save
Dim d As Double = DataTables("分切工piao信息").SQLCompute("sum(分切净重_合计)","流水号 = '"& Tables("核数表").current("流水号") &"'")
For Each pr As DataRow In DataTables("分切工piao信息").Select("流水号 = '" & Tables("核数表").current("流水号") &"'")
If pr IsNot Nothing Then
pr("半成品净重") = pr("分切净重_合计")/d *dr("半成品净重")
pr.save
End If
Next
End If
[此贴子已经被作者于2015/3/2 9:55:06编辑过]