以文本方式查看主题

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

--  作者:133198609
--  发布时间:2017/3/29 16:11:00
--  跨表查询筛选
Dim lst1 AS New List(of DataRow)
For Each dr As DataRow In DataTables("表A").DataRows
    If DataTables("表A").Find("第二列 = " & dr("第一列")) Is Nothing Then
        lst1.Add(dr)
    End If
Next

然后怎么把表A的筛选设置成lst1呢?也就是显示所有符合条件的行

--  作者:有点色
--  发布时间:2017/3/29 16:31:00
--  
Dim lst1 As New List(of String)
For Each dr As DataRow In DataTables("表A").DataRows
    If DataTables("表A").Find("第二列 = \'" & dr("第一列") & "\'") Is Nothing Then
        lst1.Add(dr("_Identify"))
    End If
Next
Tables("表A").Filter = "_Identify in (" & ("-1," & String.Join(",", lst1.ToArray)).trim(",") & ")"

--  作者:133198609
--  发布时间:2017/3/29 17:36:00
--  
好吧,还想可以更直接的办法呢。只好这样了。
--  作者:有点色
--  发布时间:2017/3/29 17:41:00
--  
Tables("表a").filter = "第一列 not in (\'" & DataTables("表a").GetComboListString("第二列").replace("|", "\',\'") & "\')"