以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  列判断  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=191769)

--  作者:yifan3429
--  发布时间:2024/5/8 18:20:00
--  列判断
 Dim dr As DataRow
    dr = wdt.sqlFind("色卡_ID = \'" & e.DataRow("色卡_ID") & "\'")
    \'    dr = wdt.sqlFind("[产品分类] = \'主材\'And [色卡_ID] = \'" & e.DataRow("色卡_ID") & "\'")
    If dr IsNot Nothing Then        
        e.DataRow("产品_单价") = dr(e.DataRow("产品_计价配件"))      会有不存在的列 
    End If
dr(e.DataRow("产品_计价配件"))  如果不存在就跳过或是当前行标红色 
[此贴子已经被作者于2024/5/8 18:20:53编辑过]

--  作者:有点蓝
--  发布时间:2024/5/9 8:35:00
--  
If wdt.datacols.contains(e.DataRow("产品_计价配件")) Then        
        Dim dr As DataRow
    dr = wdt.sqlFind("色卡_ID = \'" & e.DataRow("色卡_ID") & "\'")
    \'    dr = wdt.sqlFind("[产品分类] = \'主材\'And [色卡_ID] = \'" & e.DataRow("色卡_ID") & "\'")
    If dr IsNot Nothing Then        
        e.DataRow("产品_单价") = dr(e.DataRow("产品_计价配件"))      会有不存在的列 
    End If
End If