以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]如何根据关联表的关联列来筛选父表?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=49060)

--  作者:737182811
--  发布时间:2014/4/11 15:06:00
--  [求助]如何根据关联表的关联列来筛选父表?
如果关联列有内容,就让其父表对应的行都筛选出来。(实际没有建立关联)
--  作者:Bin
--  发布时间:2014/4/11 15:10:00
--  
Dim Products As List(Of String)
Products DataTables("子表").GetValues("关联列")
dim ids as string
For Each Product As String In Products 
    ids = ids & ",\'" & Product & "\'"
Next
tables("父表").Filter="关联列 in (" & ids.trim(",") & ")"

--  作者:737182811
--  发布时间:2014/4/11 15:36:00
--  
奇怪啊 ,为何要trim掉","
语法中明明有","
但调试证明bin版是伟大的。


原文
[国籍] In (\'中国\',\'美国\',\'英国\',\'法国\',\'俄罗斯\')

--  作者:737182811
--  发布时间:2014/4/11 15:37:00
--  
哦,明白了,是trim掉头尾的,当中没trim,谢谢bin版