以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  运算符后缺少操作数  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=50368)

--  作者:minkaia
--  发布时间:2014/5/5 19:03:00
--  运算符后缺少操作数
If e.DataRow.isnull("数量_核实数量")=False Then
    Dim sl As DataRow = DataTables("采购订单总表").Find("采购单号=\'" & e.DataRow("采购单号") & "\' 订单行号=\'" & e.DataRow("订单行号") & "\'")
    Dim sl1 As DataRow = DataTables("采购入库").Find("采购单号=\'" & e.DataRow("采购单号") & "\' 订单行号=\'" & e.DataRow("订单行号") & "\'")
    If sl IsNot Nothing Then
        sl("完成情况_已收货数量")=sl1("数量_核实数量")
    End If
End If

--  作者:有点甜
--  发布时间:2014/5/5 19:05:00
--  

这样改

 

If e.DataRow.isnull("数量_核实数量")=False Then
    Dim sl As DataRow = DataTables("采购订单总表").Find("采购单号=\'" & e.DataRow("采购单号") & "\' and 订单行号=\'" & e.DataRow("订单行号") & "\'")
    Dim sl1 As DataRow = DataTables("采购入库").Find("采购单号=\'" & e.DataRow("采购单号") & "\' and 订单行号=\'" & e.DataRow("订单行号") & "\'")
    If sl IsNot Nothing Then
        sl("完成情况_已收货数量")=sl1("数量_核实数量")
    End If
End If


--  作者:y2287958
--  发布时间:2014/5/5 19:06:00
--  
sl1”也要判断一下的
还有条件表达式中也要有“and”的
[此贴子已经被作者于2014-5-5 19:07:17编辑过]

--  作者:minkaia
--  发布时间:2014/5/5 19:06:00
--  
是否  Dim sl As DataRow = DataTables("采购订单总表").Find("采购单号=\'" & e.DataRow("采购单号") & "\' 订单行号=\'" & e.DataRow("订单行号") & "\'")缺少一个and 要怎么加?


--  作者:有点甜
--  发布时间:2014/5/5 19:07:00
--  

最后这样改

 

If e.DataRow.isnull("数量_核实数量")=False Then
    Dim sl As DataRow = DataTables("采购订单总表").Find("采购单号=\'" & e.DataRow("采购单号") & "\' and 订单行号=\'" & e.DataRow("订单行号") & "\'")
    Dim sl1 As DataRow = DataTables("采购入库").Find("采购单号=\'" & e.DataRow("采购单号") & "\' and 订单行号=\'" & e.DataRow("订单行号") & "\'")
    If sl IsNot Nothing AndAlso sl1 IsNot Nothing Then
        sl("完成情况_已收货数量")=sl1("数量_核实数量")
    End If
End If