For Each dr As DataRow In DataTables("驻外").DataRows Dim temp As String If filter > "" temp = filter & "and 接收者 Like '%" & dr("姓名") & "%' " Else temp = "接收者 Like '%" & dr("姓名") & "%' " End If dr("天数") = DataTables("事务主表").Compute("sum(天数)", temp) Next