以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何根据前面的日期型推出当月天数  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=74399)

--  作者:suha_splendid
--  发布时间:2015/9/10 9:52:00
--  如何根据前面的日期型推出当月天数
A列为日期型2015-7-01       在B列直接显示31
--  作者:大红袍
--  发布时间:2015/9/10 10:05:00
--  

参考 http://www.foxtable.com/help/topics/0265.htm

 


--  作者:大红袍
--  发布时间:2015/9/10 10:07:00
--  

DataColChanged事件

 

If e.DataCol.Name = "A" Then
   
    If e.NewValue = Nothing Then
       
        e.DataRow("B") = Nothing
       
    Else
       
        e.DataRow("B") = Date.DaysInMonth(e.NewValue.Year,e.NewValue.Month)
       
    End If
   
End If