If e.DataCol.Name = "姓名" Then
Dim Filter As String = "[姓名] = '" & e.NewValue & "'"
Dim m As Integer = CurrentTable.Current("日期").Month
Dim y As Integer = CurrentTable.Current("日期").Year
Dim dt1 As New Date(y, m, 1)
Dim dt2 As New Date(y, m, Date.DaysInMonth(y, m)) '获取本月的最后一天
Filter = filter & " and 日期 >= #" & dt1 & "# And 日期 <= #" & dt2 & "#"
e.DataRow("借支") = DataTables("借支表").Compute("Sum(金额)",filter)
End If
试一下