Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:取值问题

1楼
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是如何?
2楼
有点蓝 发表于:2025/3/7 14:23:00
e.NewValue表示的是触发的列的值,这里表示是"购货单位"的值。其它列使用e.datarow获取
3楼
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


执行后,没报错,也没有反应,如何解决?
4楼
有点蓝 发表于:2025/3/7 17:11:00
认真看2楼
  
[规格型号] = '" & 其它列使用e.datarow获取 & "'
共4 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .05469 s, 2 queries.