Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
假定新增行的 日期 列是 2012-01-12 现在要让 年份 列自动输入 2012
求表事件的代码
年份列是用于做表间关联的,所以不能是表达式列。
DataColChanged事件
Select Case e.DataCol.Name
Case "日期"
If e.DataRow.IsNull("日期") Then
e.DataRow("年份") = Nothing
Else
e.DataRow("年份") = cdate(e.DataRow("日期")).year
End If
End Select
DataRowAdding事件
e.DataRow("日期") = Date.Today
非常感谢! OK