以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  筛选  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=74058)

--  作者:CM12345678
--  发布时间:2015/9/1 11:30:00
--  筛选

Tables("A").RepeatFilter("第一列", 0)


--  作者:CM12345678
--  发布时间:2015/9/1 11:32:00
--  

在表A进行筛选,显示第一列,第二列,第三列,这3列内容都重复的行,代码应该怎么写?


--  作者:大红袍
--  发布时间:2015/9/1 12:18:00
--  

重复筛选代码

 

Dim idx As String = "-1,"
Dim idx_temp As String = ""
Dim pdr As DataRow = Nothing
Dim count As Integer = 0
Dim cs As String = "第一列,第二列,第三列"
For Each dr As DataRow In DataTables("表A").Select("", cs)
   
    Dim flag As Boolean = False
    If pdr IsNot Nothing Then
        For Each c As String In cs.split(",")
            If pdr(c) <> dr(c) Then
                flag = True
                Exit For
            End If
        Next
    End If
    If flag Then
        If count > 1 Then
            idx &= idx_temp
        End If
        count = 1
        idx_temp = ""
    Else
        count += 1
    End If
    idx_temp &= dr("_Identify") & ","
    pdr = dr
Next

If count > 1 Then
    idx &= idx_temp
End If

Tables("表A").filter = "_Identify in (" & idx.trim(",") & ")"