如果截止日期已经输入,不能用表达式列,用数据列,在DataColchanged事件设置代码:
if e.DataCol.Name = "截止日期" then
if e.dataRow.Isnull("截止日期") Orelse e.DataRow("截止日期") > Date.Today Then
e.DataRow("过期") = False
Else
e.DataRow("过期") = True
End if
End if
在AfterOpenProject事件加上代码:
DataTables("表名").DataCols("截止日期").RaiseDataColChanged()
这样每次打开项目,就会自动刷新。