If e.DataCol.Name = "第三列" Then If e.DataRow("第三列") <> "已提交" Then e.DataRow("第一列") = Nothing Else Dim y As Integer = Date.Today.Year Dim qz As String = Tables("表B").Rows(0)("第二列") Dim bh_temp As String = qz & "字[[]" & y & "[]]" Dim bh As String = qz & "字[" & y & "]" Dim max As String Dim idx As Integer max = e.DataTable.Compute("Max(第一列)","第一列 like '" & bh_temp & "%' And [_Identify] <> " & e.DataRow("_Identify")) If max > "" Then '如果存在最大编号 idx = CInt(max.Substring(bh.Length, 5)) + 1 '获得最大编号的后三位顺序号,并加1 Else idx = 1 '否则顺序号等于1 End If e.DataRow("第一列") = bh & Format(idx,"00000") & "号" End If End If
|