以文本方式查看主题

-  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=162844)

--  作者:sanny
--  发布时间:2021/4/16 21:12:00
--  [求助] 关联子表

老师,以下黄色的关联子表,要怎样使用才是正确的 ?

For Each r1 As DataRow In DataTables("PriceNew.Pricelist").Select("[FPrioritized] = true ")

    Dim fdr As DataRow = DataTables("Pricelist").Find("FNumber = \'" & r1("FNumber") & "\' and FNumber1 = \'" & r1("FNumber1") & "\'")
    If fdr IsNot Nothing Then
        fdr("FPrioritized") = r1("FPrioritized")
          
    End If

Next

DataTables("Pricelist").save

msgbox("Done !!!")

--  作者:有点蓝
--  发布时间:2021/4/17 9:48:00
--  
For Each r1 As Row In Tables("PriceNew.Pricelist").rows
if r1("FPrioritized") = true 
    Dim fdr As DataRow = DataTables("Pricelist").Find("FNumber = \'" & r1("FNumber") & "\' and FNumber1 = \'" & r1("FNumber1") & "\'")
    If fdr IsNot Nothing Then
        fdr("FPrioritized") = r1("FPrioritized")
          
    End If
End If
Next