参考:
http://www.foxtable.com/webhelp/scr/1572.htm
Select Case e.DataCol.Name
Case "收入","支出"
For Each dr As DataRow In e.DataTable.Select("[_SortKey] >= " & e.DataRow("_SortKey"))
Dim Val1 As Double = e.DataTable.Compute("Sum(收入)","[_SortKey] <= " & dr("_SortKey"))
Dim Val2 As Double = e.DataTable.Compute("Sum(支出)","[_SortKey] <= " & dr("_SortKey"))
dr("余额") = Val1 - Val2
Next
End Select
[此贴子已经被作者于2017/10/31 23:41:10编辑过]