以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  过期30天后不再提示  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=148298)

--  作者:鲁吉
--  发布时间:2020/4/4 10:31:00
--  过期30天后不再提示
要实现三天内到期的弹窗提示“即将到期”数据涂黄,而过期30天后不再提示,但数据涂红。
下面代码:三天内到期和过期后提示,请问代码怎么改?
Dim dte2 As Date = Date.Today.AddDays(3)
Dim dr As DataRow = DataTables("改正").Find("限定日期 <= #" & dte2 & "#")
If dr IsNot Nothing Then
MessageBox.Show("有过期,或即将到期!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Tables("改正").Filter = "限定日期 <= #" & dte2 & "#"
Forms("查阅").open
End If

--  作者:有点蓝
--  发布时间:2020/4/5 21:04:00
--  
Dim dte2 As Date = Date.Today.AddDays(3)
Dim dte3 As Date = Date.Today.AddDays(-30)
Dim dr As DataRow = DataTables("改正").Find("限定日期 <= #" & dte2 & "# and  限定日期 >= #" & dte3 & "#")
If dr IsNot Nothing Then
    MessageBox.Show("有过期,或即将到期!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Tables("改正").Filter = "限定日期 <= #" & dte2 & "# and  限定日期 >= #" & dte3 & "#"
    Forms("查阅").open
End If