此主题相关图片如下:mls.jpg
各位老师,深夜辛苦了!!
以上是在窗口目录树结构,在AfterCheckNode事件中代码如下,不知怎么写第三层目录的筛选代码。感谢老师们帮忙,谢谢!!
Dim trv As WinForm.TreeView = e.Sender
Dim flt As String
For Each nd As WinForm.TreeNode In e.node.Nodes '清除子节点选中状态
nd.Checked = False
Next
If e.node.ParentNode IsNot Nothing Then '去掉父节点选中状态
e.node.ParentNode.Checked = False
End If
For Each nd As WinForm.TreeNode In trv.AllNodes
If nd.Checked Then
If flt > "" Then
flt = flt & " Or " '注意用or而不是And
End If
If nd.Level = 0 Then '注意下面的条件都要用括号括起来
flt = flt & "( 区域分组 = '" & nd.Text & "')"
Else
flt = flt & "( 区域分组 = '" & nd.ParentNode.Text & "' And 所在省份 = '" & nd.Text & "')"
' Else
' flt = flt & "( 区域分组 = '" & nd.ParentNode.Text & "' And 所在省份 = '" & nd.Text & "' And 所在城市 = '" & nd.Text & "')"
End If
End If
Next
Tables("客户管理").Filter = flt