呃,测试没有任何问题
If e.Col.name = "单击_接下任务" Then
Dim r As Row = Tables("任务总部").Current
r.DataRow.Load() '重新加载此行的数据
Dim dt1 As Date = Date.Today.AddDays(-15) '获取第一天
Dim dt2 As Date = Date.Today.AddDays(1) '获取最后一天
Dim daa As String = r("发任务人")
Dim fdr As DataRow = DataTables("任务流水表").find("[任务内容] = '" & r("任务内容") & "' and [接任务人] = '" & User.Name & "' And [发任务人] = '" & daa & "' And [接下时间] >= #" & dt1 & "# And [接下时间] <= #" & dt2 & "# " ) '查找同一任务 15天内是否接过任务
If fdr IsNot Nothing Then '如果找到的话
MessageBox.Show("亲15天内接过此人的任务!")
Else
Dim ww As DataRow = DataTables("任务流水表").AddNew() '增加一行
Dim xx As Row = Tables("任务总部").Current
ww("发任务人") = xx("发任务人")
ww("接任务人") = User.Name
ww("任务内容") = xx("任务内容")
MessageBox.Show("已接下任务!")
End If
End If