以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 同表复制行代码有错? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=143149) |
||||
-- 作者:旭日生 -- 发布时间:2019/11/15 9:38:00 -- 同表复制行代码有错? 在编号不为空的情况下,如果卷号和年度相同,则复制已有数据的最后一行数据。感觉代码没错,但实现不了,没想明白。请版主帮看一下为什么?
|
||||
-- 作者:有点蓝 -- 发布时间:2019/11/15 9:57:00 -- Case "卷号","年度" Dim i As Integer If Integer.TryParse(e.DataRow("卷号"),i)Then e.DataRow("卷号") = Format(i, "00000") Else e.DataRow("卷号") = e.DataRow("卷号").PadLeft(5,"0").ToUpper() End If If e.DataRow.Isnull("卷号") OrElse e.DataRow.IsNull("年度") OrElse e.DataRow("卷号") = "00000" Then e.DataRow("数量") = Nothing e.DataRow("日期") = Nothing Else Dim dr As DataRow = e.DataRow Dim fdr As DataRow = DataTables("举例测试").find("卷号 = \'" & dr("卷号") & "\' And 年度 = \'" & dr("年度") & "\' and 编号 is not null and [_Identify] <> " & dr("_Identify"),"[_Identify] desc") If fdr IsNot Nothing Then e.DataRow("数量") = fdr("数量") e.DataRow("日期") = fdr("日期") End If End If
|
||||
-- 作者:旭日生 -- 发布时间:2019/11/15 10:20:00 -- 明白了。感谢蓝版! |