能帮忙看看这短代码吗
设置筛选的两个条就是 债权人的最后一行的分别欠款不为0的,第二只筛选出相同债权人的最后一行,
比如债权人有a和b 还有c 其中债权人为a的欠款明细追后一行为0,那么债权人为a的都不显示,
剩下的只显示最后一行,比如b和c最后一行不为0,那么只显示b和c的最后行,感谢 感谢
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("欠款明细").Select("", cs)
Dim flag As Boolean = False
If pdr IsNot Nothing Then
For Each c As String In cs.split(",")
If pdr(c).replace(" ","") <> dr(c).replace(" ", "") Then
flag = True
Exit For
End If
Next
If flag Then
If pdr("欠款明细") <> 0 Then
idx &= pdr("_Identify") & ","
End If
End If
End If
pdr = dr
Next
If pdr IsNot Nothing Then
If pdr("欠款明细") <> 0 Then
idx &= pdr("_Identify") & ","
End If
End If
e.Form.controls("Table6").Table.Filter = "_Identify In (" & idx.trim(",") & ")"