Dim trv As WinForm.TreeView = e.Sender
Dim flt,a,b,c As String
For Each nd As WinForm.TreeNode In e.node.Nodes '同步子节点选中状态
nd.Checked = e.Node.Checked
Next
If e.node.ParentNode IsNot Nothing Then '去掉父节点选中状态
e.node.ParentNode.Checked = False
End If
Dim ndf As WinForm.TreeNode = trv.SelectedNode
If ndf IsNot Nothing Then
If ndf.Checked Then
If ndf.Level = 0 Then '注意下面的条件都要用括号括起来
a = ndf.Text
flt = " 审核 = '" & a & "'"
End If
If ndf.Level = 1 Then
a = ndf.ParentNode.text
b = ndf.Text
flt = "审核 = '" & a & "' And 客户 = '" & b & "'"
End If
If ndf.Level = 2 Then
Dim pth() As String = ndf.FullPath.Split("\")
a = pth(0)
b = pth(1)
c = ndf.Text
flt = "审核 = '" & a & "' And 客户 = '" & b & "' And 款号= '" & c & "'"
End If
End If
End If
Tables("订单标准").Filter = flt