老师好,逻辑列下有两个字段分别是:到期和续签,如果是续签就停止下面代码,周期为一年,一年过后到期不续签重新运行下面代码。 谢谢老师。
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
If e.Col.Name = "结束时间" Then
If e.Row.IsNull("结束时间") = False
if e.Row("续签")
If e.Row("结束时间").addyears(1) < Date.Today.AddDays(10) Then
e.Style = "到期"
End If
else
If e.Row("结束时间") < Date.Today.AddDays(10) Then
e.Style = "到期"
End If
endif
End If
End If
老师,下面代码“结束时间”剩余天数应该为零可还有一天不为零。
Select Case e.DataCol.name
Case "结束时间"
If e.DataRow.IsNull("结束时间") Then
e.DataRow("剩余_年") = Nothing
e.DataRow("剩余_月") = Nothing
e.DataRow("剩余_天") = Nothing
Else
If e.DataCol.Name = "结束时间" And e.DataRow("结束时间") > Date.Today Then
Dim y,m,d As Integer
DateYMD(e.DataRow("结束时间"),Date.Today,y,m,d)
e.DataRow("剩余_年") = y
e.DataRow("剩余_月") = m
e.DataRow("剩余_天") = d
End If
End If
End Select