下面这段代码,到了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