以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  复制粘贴错误  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=122389)

--  作者:lfz123
--  发布时间:2018/7/24 14:56:00
--  复制粘贴错误

这个错误不是经常会出现,同一个粘贴复制的动作,前面几个单元格都没报错,后面有可能就出现报错,

但我只是简单的复制 工程编码 而已,并没有编辑 工程发票消账码

If e.DataCol.name = "工程发票消账码" Then
    Dim drs  As List (of DataRow ) =  DataTables("销项发票").Select("工程发票消帐码 = \'"& e.datarow("工程发票消账码") & "\'")
    For Each dr As DataRow In drs
        If e.DataRow.IsNull("工程发票消账码") Then
            dr("收款状况") = Nothing
            e.DataRow("摘要") = Nothing
            e.DataRow("工程编码") = Nothing
        Else
            Dim str As String = e.DataRow("日期") & "已收款" & e.DataRow("收入")
            dr("收款状况") = str
            e.DataRow("摘要") = "收" & dr("发票抬头") & ":" & dr("备注") & "工程款"
            e.DataRow("工程编码") = dr("工程编码")
        End If
    Next
End If

 


图片点击可在新窗口打开查看此主题相关图片如下:不知名错误.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:不知名错误2.png
图片点击可在新窗口打开查看

--  作者:有点甜
--  发布时间:2018/7/24 15:20:00
--  

试试

 

systemready = False
If e.DataCol.name = "工程发票消账码" Then
    Dim drs  As List (of DataRow ) =  DataTables("销项发票").Select("工程发票消帐码 = \'"& e.datarow("工程发票消账码") & "\'")
    For Each dr As DataRow In drs
        If e.DataRow.IsNull("工程发票消账码") Then
            dr("收款状况") = Nothing
            e.DataRow("摘要") = Nothing
            e.DataRow("工程编码") = Nothing
        Else
            Dim str As String = e.DataRow("日期") & "已收款" & e.DataRow("收入")
            dr("收款状况") = str
            e.DataRow("摘要") = "收" & dr("发票抬头") & ":" & dr("备注") & "工程款"
            e.DataRow("工程编码") = dr("工程编码")
        End If
    Next
End If
systemready = True