报错,是哪有问题?
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2020.5.29.8
错误所在事件:表,试样保存明细台账,DataColChanged
详细错误信息:
调用的目标发生了异常。
该字符串未被识别为有效的 DateTime。有一个未知单词(从索引 0 处开始)。
Select e.DataCol.Name
Case "标识号","试样代号"
If e.DataRow.IsNull("标识号") OrElse e.DataRow.IsNull("试样代号") Then
e.DataRow("试样编号_流水号") = Nothing
Else
Dim ld As String = e.DataRow("标识号")
Dim fd As String = e.DataRow("试样代号")
Dim bh As String = e.DataRow("标识号") & e.DataRow("试样代号") & "-"
If e.DataRow("试样编号_流水号").StartsWith(bh) = False
Dim max As String
Dim idx As Integer
Dim flt As String
flt = "标识号 = '"& e.DataRow("标识号") & "' And 试样代号 >= #" & fd & "# And 试样代号 <= #" & ld & "# And [_Identify] <> " & e.DataRow("_Identify")
max = e.DataTable.Compute("Max(试样编号_流水号)",flt)
If max > "" Then
idx = CInt(max.Substring(max.length - 1)) + 1
Else
idx = 1
End If
e.DataRow("试样编号_流水号") = bh & Format(idx,"0")
End If
End If
End Select