Select e.DataCol.Name
Case "系列"
If e.DataRow.IsNull("系列") Then
e.DataRow("联号") = Nothing
Else
Dim lb As String = e.DataRow("系列")
If e.DataRow("联号").StartsWith(lb) = False '如果单据编号前缀不符
Dim max As String
Dim idx As Integer
max = e.DataTable.Compute("Max(联号)","系列 = '" & lb & "' And [_Identify] <> " & e.DataRow("_Identify")) '取得该类别的最大编号
If max > "" Then '如果存在最大编号
idx = CInt(max.Substring(4,4)) + 1 '获得最大编号的后三位顺序号,并加1
Else
idx = 1 '否则顺序号等于1
End If
e.DataRow("联号") = lb & Format(idx,"0000")
End If
End If
End Select
以上代码运行后提示如下错误,应该如何修改:
.NET Framework 版本:2.0.50727.3053
Foxtable 版本:2013.10.14.1
错误所在事件:表,联号清单,DataColChanged
详细错误信息:
调用的目标发生了异常。
索引和长度必须引用该字符串内的位置。
参数名: length