以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  当前遍历只实现了查找的不重复值的第一行数据更新,怎么实现遍历所有不重复值的所有行数据都更新呢?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=174647)

--  作者:cnsjroom
--  发布时间:2022/1/25 10:48:00
--  当前遍历只实现了查找的不重复值的第一行数据更新,怎么实现遍历所有不重复值的所有行数据都更新呢?

当前遍历只实现了查找的不重复值的第一行数据更新,怎么实现遍历所有不重复值的所有行数据都更新呢?

红色部分代码 怎么改成遍历呢?

 

想实现当uui找到后  就去找凭证号里面的uuid   只有唯一的一个    然后去更新费用类目下 的所有uuid相等的数据值   而不是只有第一条更新

当前代码如下:

Dim Customers As List(Of String)
Customers = DataTables("费用类目").GetValues("uuid")
For Each Customer As String In Customers
    Output.Show(Customer)
    Dim bb As DataRow = DataTables("凭证号").Find("uuid= \'" & Customer & "\'")
    Dim b As DataRow = DataTables("费用类目").Find("uuid= \'" & Customer & "\'")

    If bb IsNot Nothing Then
        If b IsNot Nothing Then
            b("凭证时间")=bb("时间")
            b("年份")=bb("年份")
            b("月份")=bb("月份")
            b("单位")=bb("凭证单位")
            b("凭证号")=bb("凭证号")
        End If
        b.Save
    End If
Next


--  作者:有点蓝
--  发布时间:2022/1/25 11:16:00
--  
方法1:http://www.foxtable.com/webhelp/topics/0400.htm