'
DataColChanged 事件(参考)If E.DataCol.Name ="本次付款金额" Then
Dim bh As String = e.DataRow("采购编号")
Dim aa As Boolean = False
For i As Integer = 0 To DataTables("表A").dataRows.Count-1
If DataTables("表A").dataRows(i)("采购编号") = bh Then
Dim dr As DataRow = DataTables("表A").DataRows(i)
If aa = False Then
dr("剩余尾款") = dr("货款总价") - dr("本次付款金额")
Else
dr("剩余尾款") = DataTables("表A").DataRows(i-1)("剩余尾款")-dr("本次付款金额")
End If
aa=True
End If
Next
End If
[此贴子已经被作者于2016/8/3 15:37:42编辑过]