筛选重复的代码
Dim idx As String = "-1,"
Dim idx_temp As String = ""
Dim pdr As DataRow = Nothing
Dim count As Integer = 0
For Each dr As DataRow In DataTables("表A").Select("", "第一列,第二列")
If pdr IsNot Nothing AndAlso (pdr("第一列") <> dr("第一列") OrElse pdr("第二列") <> dr("第二列")) 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(",") & ")"