入库明细
DataColChanged
If e.DataCol.Name = "入库重量" Then
Dim dr As DataRow = DataTables("采购计划明细表").Find("物资编号 = '" & e.DataRow("物资编号") & "'")
If dr IsNot Nothing Then
DataTables("采购计划明细表").DataCols("物资编号").RaiseDataColChanged(dr)
End If
End If
DataRowDeleting
正在删除一行的时候执行,这时行还未被删除。
e.DataRow("入库重量") = Nothing
Dim pr As DataRow
pr = DataTables("采购计划明细表").Find("物资编号 = '" & e.DataRow("物资编号") & "'")
If pr IsNot Nothing Then
DataTables("采购计划明细表").DataCols("物资编号").RaiseDataColChanged(pr)
End If
采购计划明细表
DataColChanged
If e.DataCol.Name = "物资编号" Then
Dim Filter As String = "[物资编号] = '" & e.NewValue & "'"
e.DataRow("已交重量") = DataTables("入库明细").Compute("Sum(入库重量)", Filter)
End If
[此贴子已经被作者于2023/3/16 15:39:11编辑过]