以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助] 主表遍历更新关联表的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=107483)

--  作者:mikee
--  发布时间:2017/9/28 17:05:00
--  [求助] 主表遍历更新关联表的问题
请教下,为什么这段代码在主表不能循环,仅被选中行的第一条执行了

With Tables("产品")
    If .TopPosition > -1 Then
        For i As Integer = .TopPosition To .BottomPosition
            For Each r As Row In Tables("产品.订单").Rows
                r("结单")=1
            Next
        Next
    End If
End With

--  作者:有点甜
--  发布时间:2017/9/28 17:13:00
--  
With Tables("产品")
    If .TopPosition > -1 Then
        For i As Integer = .TopPosition To .BottomPosition
            For Each r As DataRow In .rows(i).DataRow.getchildrows("订单")
                r("结单")=1
            Next
        Next
    End If
End With