這樣或通用些:
Dim Lms As String = "上级部门,单位名称,姓名"
Dim Lmst() As String = Lms.Split(",")
Dim str0 As New List (Of String)
Dim str1 As New List (Of String)
Dim id0,id1,flt,celltext As String
'+++++++++++++++++++++++++++++++++
For Each r As Row In CurrentTable.Rows
celltext=Nothing
For i As Integer = 0 To Lmst.Length-1
celltext+=r(Lmst(i))
Next
If str0.Contains(celltext) =False Then
id0 + = r("_Identify") & ","
Else
str1.Add(celltext)
End If
str0.Add(celltext)
Next
'++++++++++++++++++++++++++++++++
For Each r As Row In CurrentTable.Rows
celltext=Nothing
For i As Integer = 0 To Lmst.Length-1
celltext+=r(Lmst(i))
Next
If str1.Contains(celltext) Then
id1 + = r("_Identify") & ","
End If
Next
'+++++++++++++++++++++++++++++++++
If id1 > "" Then
id1 = id1.Trim(",")
flt = "_Identify In (" & id1 & ")"
End If
CurrentTable.Filter = flt
CurrentTable.Sort= Lms
[此贴子已经被作者于2015/7/2 1:13:42编辑过]