以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  日期 如何返回 星期几  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=96245)

--  作者:puresky
--  发布时间:2017/2/16 11:02:00
--  日期 如何返回 星期几
table中有一列是日期,新增一列,如何自动产生星期几。求相助,这些数据变化,是最常用的啊。
--  作者:有点色
--  发布时间:2017/2/16 11:26:00
--  

DataColChanged事件

 

If e.DataCol.name = "日期" Then
    If e.NewValue <> nothing Then
        e.DataRow("星期") = format(e.NewValue, "dddd")
    Else
        e.DataRow("星期") = Nothing
    End If
End If

[此贴子已经被作者于2017/2/16 11:26:20编辑过]

--  作者:puresky
--  发布时间:2017/2/16 11:45:00
--  
if e.newvalue <> nothing 能否写成   if e.datarow.isnull("日期")
--  作者:有点色
--  发布时间:2017/2/16 11:55:00
--  

写成

 

If e.datarow.isnull("日期") = False Then