Foxtable(狐表)用户栏目专家坐堂 → 自动输入日期问题


  共有1505人关注过本帖平板打印复制链接

主题:自动输入日期问题

帅哥,在线噢!
edisontsui
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1485 积分:9626 威望:0 精华:0 注册:2014/12/18 16:12:00
自动输入日期问题  发帖心情 Post By:2017/12/1 11:03:00 [只看该作者]

下面这段代码,到了12月份的今天,就无法自动输入日期列了,请问代码错在哪里?谢谢!




If e.DataCol.Name = "piao号"

    If e.DataRow("piao号") Is Nothing

    Else

        Dim dr As DataRow = e.DataRow

        If e.DataRow("piao号").Length = 10

            e.DataRow("piao号") = "0" & e.DataRow("piao号")

        End If

        Dim da As String

        Dim d1 As Date = Date.today

        If d1.Month = 12

            If dr("piao号").StartsWith("01")

                da = d1.year + 1"-" & dr("piao号").Substring( 0, 2) & "-" & dr("piao号").Substring( 2, 2)

            End If

        Else

            da = d1.year &  "-" & dr("piao号").Substring( 0, 2) & "-" & dr("piao号").Substring( 2, 2)

            dr("日期") = Cdate(da)

        End If

      dr("工位") = dr("piao号").substring(4,3

    End If

End If


 回到顶部