'''
If e.DataCol.Name = "付款单位" Then
Dim T As String
Dim mny,sum As Double
Dim Da As DataTable = DataTables("总表")
mny = e.DataRow("金额")
if mny <=0 then
MessageBox.Show("请输入金额!", "提示")
Else
T = "发货单位 = '" & e.NewValue & "'"
if Da.Find(T) isNot nothing then
for each dr As DataRow in Da.select(T)
sum = Da.Compute("Sum(运费结算_已收)",T)
if sum = mny
Exit For
end if
if mny - sum >= dr("运费结算_应收费")
dr("运费结算_已收") = dr("运费结算_应收费")
Else
dr("运费结算_已收") = mny - sum
End if
Next
end if
end if
end if
[此贴子已经被作者于2008-12-19 12:58:20编辑过]