以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助].NET Framework 版本:2.0.50727.5472 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=71726) |
||||
-- 作者:ZDG -- 发布时间:2015/7/16 21:47:00 -- [求助].NET Framework 版本:2.0.50727.5472
个位老师,帮忙看看,为什么调试好的表,忽然就报错了
|
||||
-- 作者:ZDG -- 发布时间:2015/7/16 21:47:00 -- 销售发货表
|
||||
-- 作者:大红袍 -- 发布时间:2015/7/16 21:49:00 -- If e.DataCol.Name = "发货日期" Then If e.DataRow.IsNull("发货日期") Then e.DataRow("单号") = Nothing Else Dim bh As String = "xs" & Format(e.DataRow("发货日期"),"yyyyMMdd") \'取得编号的8位前缀 If e.DataRow("单号").StartsWith(bh) = False \'如果编号的前8位不符 Dim max As String Dim idx As Integer max = e.DataTable.Compute("Max(单号)","发货日期 = #" & e.DataRow("发货日期") & "# And [_Identify] <> " & e.DataRow("_Identify")) \'取得该天的最大编号 If max > "" Then \'如果存在最大编号 idx = CInt(max.Substring(bh.Length)) + 1 \'获得最大编号的后三位顺序号,并加1 Else idx = 1 \'否则顺序号等于1 End If e.DataRow("单号") = bh & Format(idx,"000") End If End If End If |