加个提示功能:
'''
If e.DataCol.Name = "收款总额" Then
Dim T As String
Dim mny,sum As Double
Dim Dt1 As DataTable = DataTables("收款明细")
mny = e.DataRow("收款总额")
If mny <=0 Then
MessageBox.Show("请输入金额!", "提示")
ElseIf e.DataRow.Isnull("收款单编号") = False Then
T = "[收款单编号] = '" & e.DataRow("收款单编号") & "'"
If dt1.Find(T) IsNot Nothing Then
sum = dt1.Compute("Sum(应收金额)",T)
If mny > sum Then
MessageBox.Show("付款金额超出应收金额:" & (mny-sum) &"!", "温馨提示")
Return
End If
For Each dr As DataRow In dt1.Select(T)
If mny <=0 Then
Exit For
Else
If mny >= dr("应收金额")
dr("已收金额") = dr("应收金额")
Else
dr("已收金额") = mny
End If
mny =mny- dr("应收金额")
End If
Next
End If
End If
End If