老师,以下两个代码用在表属性中。当表SDBC_Sq删除记录后,为什么表Incoming中的QCQty 没有更新 ?
If e.DataCol.Name = "BatchNo" Then
Dim sum As Double= 0
For Each dr1 As DataRow In DataTables("SDBC_Sq").Select("BatchNo='" & e.NewValue & "'")
sum += dr1("IncomingQty")
Next
e.DataRow("QCQty") = sum
End If
If e.DataCol.Name = "BatchNo" OrElse e.DataCol.Name = "IncomingQty" Then
Dim pr As DataRow
pr = DataTables("Incoming").Find("BatchNo = '" & e.DataRow("BatchNo") & "'")
If pr IsNot Nothing Then
DataTables("Incoming").DataCols("BatchNo").RaiseDataColChanged(pr)
End If
End If