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