以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]DrawCell事件代码  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=72817)

--  作者:why305
--  发布时间:2015/8/6 18:03:00
--  [求助]DrawCell事件代码

设置表的DrawCell事件代码,标出10天内即将到期的产品:

If e.col.Name = "到期日期" Then
If
e.Row.IsNull("到期日期") = False
If
e.Row("到期日期") < Date.Today.AddDays(10) Then
e.Style =
"到期"
End If
End
If
End
If

 

日期如果过了今天就用默认的样式,不用自定义样式了。应该怎么写呢?


--  作者:大红袍
--  发布时间:2015/8/6 18:05:00
--  
If e.Col.Name = "到期日期" Then
    If e.Row.IsNull("到期日期") = False
        If  e.Row("到期日期") >= Date.Today AndAlso e.Row("到期日期") < Date.Today.AddDays(10) Then
            e.Style = "到期"
        End If
    End If
End If

--  作者:why305
--  发布时间:2015/8/6 18:08:00
--  
以下是引用大红袍在2015/8/6 18:05:00的发言:
If e.Col.Name = "到期日期" Then
    If e.Row.IsNull("到期日期") = False
        If  e.Row("到期日期") >= Date.Today AndAlso e.Row("到期日期") < Date.Today.AddDays(10) Then
            e.Style = "到期"
        End If
    End If
End If

谢谢