以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  取值问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=195763)

--  作者:lgz518
--  发布时间:2025/3/7 13:42:00
--  取值问题
If e.DataCol.Name = "购货单位" Then
    If e.NewValue Is Nothing Then
        e.DataRow("地址") = Nothing
        e.DataRow("下单日期") = Nothing
        e.DataRow("发货日期") = Nothing
        e.DataRow("税价") = Nothing
        e.DataRow("税率") = Nothing
    Else
        Dim dr As DataRow

        
 dr = DataTables("产品销售记录表").Find("[购货单位] = \'" & e.NewValue & "\' And  [规格型号] = \'" & e.NewValue & "\' And  [销售数量] = \'" & e.NewValue & "\'")
        
        If dr IsNot Nothing Then
            e.DataRow("地址") = dr("地址")
            e.DataRow("下单日期") = dr("下单日期")
            e.DataRow("发货日期") = dr("发货日期")
            e.DataRow("税价") = dr("税价")
            e.DataRow("税率") = dr("税率")
        End If
    End If
End If

问题:
报错:= \'",

[销售数量] = \'" & e.NewValue是如何?

--  作者:有点蓝
--  发布时间:2025/3/7 14:23:00
--  
e.NewValue表示的是触发的列的值,这里表示是"购货单位"的值。其它列使用e.datarow获取
--  作者:lgz518
--  发布时间:2025/3/7 16:53:00
--  
If e.DataCol.Name = "购货单位" Then
    If e.NewValue Is Nothing Then
        e.DataRow("地址") = Nothing
        e.DataRow("下单日期") = Nothing
\'        e.DataRow("发货日期") = Nothing
\'        e.DataRow("税价") = Nothing
\'        e.DataRow("税率") = Nothing
    Else
        Dim dr As DataRow

        
         dr = DataTables("产品销售记录表").Find("[购货单位] = \'" & e.NewValue & "\' And  [规格型号] = \'" & e.NewValue & "\' And  [销售数量] = \'" & e.NewValue & "\'")
        
        If dr IsNot Nothing Then
            e.DataRow("地址") = dr("地址")
            e.DataRow("下单日期") = dr("下单日期")
\'            e.DataRow("发货日期") = dr("发货日期")
\'            e.DataRow("税价") = dr("税价")
\'            e.DataRow("税率") = dr("税率")
        End If
    End If
End If


执行后,没报错,也没有反应,如何解决?

--  作者:有点蓝
--  发布时间:2025/3/7 17:11:00
--  
认真看2楼
  
[规格型号] = \'" & 其它列使用e.datarow获取 & "\'