.NET Framework 版本:2.0.50727.5485
Foxtable 版本:2017.10.26.1
错误所在事件:
详细错误信息:
字符串 ' And [_Identify] <> 37' 后的引号不完整。
If e.DataCol.Name = "日期" Then
If e.DataRow.IsNull("日期") Then
e.DataRow("产品号") = Nothing
Else
Dim d As Date = e.DataRow("日期")
Dim lb As String = "CP"
Dim y As Integer = d.Year
Dim m As Integer = d.Month
Dim Days As Integer = Date.DaysInMonth(y,m)
Dim fd As Date = New Date(y,m,1) '获得该月的第一天
Dim ld As Date = New Date(y,m,Days) '获得该月的最后一天
Dim bh As String = Format(d,"yyyyMM") '生成产品号的前6位,4位年,2位月.
If e.DataRow("产品号").StartsWith(bh) = False '如果产品号的前6位不符
Dim max As String
Dim idx As Integer
max = e.DataTable.sqlCompute("Max(产品号)","日期 >= '" & fd & "' And 日期 <= #" & ld & "' And [_Identify] <> " & e.DataRow("_Identify")) '取得该月的最大产品号
If max > "" Then '如果存在最大产品号
idx = CInt(max.Substring(10,5)) + 1 '获得最大产品号的后三位顺序号,并加1
Else
idx = 1 '否则顺序号等于1
End If
e.DataRow("产品号") = lb &"-" & bh & "-" & Format(idx,"00000")
End If
End If
End If
'If e.DataCol.Name = "状态" Then '如果是已结帐列的内容变动
'If e.NewValue <> "新单" Then '而且变动后的值是True(已勾选)
'e.DataRow.Locked = True '那么锁定此行
'End If
'End If
[此贴子已经被作者于2017/12/7 17:01:27编辑过]