以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  身份证提取日期  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=86230)

--  作者:lfxxdt
--  发布时间:2016/6/13 15:24:00
--  身份证提取日期
身份证号码如何提取日期
--  作者:ericotaku
--  发布时间:2016/6/13 15:26:00
--  
写在表的DataColChanged里

 \'*************************
\'以下代码是根据身份证自动生成生日和性别
If e.DataCol.Name = "身份证" Then \'是身份证号码发生变化吗?
    If e.DataRow.IsNull("身份证") Then \'身份证号码是否为空
        e.DataRow("出生日期") = Nothing \'如果为空,则清除出生日期
        e.DataRow("性别") = Nothing
    Else
        \'否则从身份证号码列中提取出生日期
        e.DataRow("出生日期") = ReadBirthday(e.DataRow("身份证"))
        e.DataRow("性别") = ReadSex(e.DataRow("身份证"))
    End If
End If