你好,我想试验一下,当文件处理表中的“到期日”前6天设置提醒,请看一下我的代码对吗 用命令窗口执行没有反应呢?谢谢Dim nms As String
Dim n As Integer = 6 '未来天数,含今天,所以实际是未来7天
For Each dr As DataRow In DataTables("文件处理").DataRows
Dim dt As Date = dr("到期日")
Dim dt1 As New Date(Date.Today.Year,dt.Month,dt.Day)
Dim dt2 As New Date(Date.Today.AddDays(n).Year,dt.Month,dt.Day)
If (dt1 >= Date.Today AndAlso dt1 < Date.Today.AddDays(n)) OrElse (dt2 >= Date.Today AndAlso dt2 < Date.Today.AddDays(n)) Then
nms = nms & ",'" & dr("文件名") & "'"
End If
Next
If nms > "" Then
nms = nms.Trim(",")
Tables("文件处理").filter = "[到期日] In (" & nms &")"
End If
此主题相关图片如下:咨询.png
