下面代码执行出现错误,不知错在哪?
此主题相关图片如下:snap1.jpg
'订单数量从销售订单明细中取数
销售订单明细的”颜色“列允许有空值
If e.DataCol.Name ="订单单号" Or e.DataCol.Name ="产品代码" Or e.DataCol.Name ="颜色" Then
If DataTables("销售订单明细").datarows("颜色") Is Nothing Then
Dim dt As DataRow = DataTables("销售订单明细").Find(" 订单单号 = " & "'" & e.DataRow("订单单号") & "'and 产品代码 = " & "'" & e.DataRow("产品代码") & "'and 颜色 = " & "'" & e.DataRow("颜色") & "'" )
If dt IsNot Nothing '如果找到,则设置各列内容
e.DataRow("订单数量")= dt("订单数量")
End If
Else
Dim df As DataRow = DataTables("销售订单明细").Find(" 订单单号 = " & "'" & e.DataRow("订单单号") & "'and 产品代码 = " & "'" & e.DataRow("产品代码") & "'" )
If df IsNot Nothing '如果找到,则设置各列内容
e.DataRow("订单数量")= df("订单数量")
End If
End If
End If