Dim flt1 As String
Dim Value() As String
Dim ls1 As New List(of String)
Value = e.Node.FullPath.Split("\")
Dim vs1() As String ={"所在部门","安装地点"}
Dim vs2() As String ={"设备大类型","设备小类型"}
Select Case e.Node.Level
Case 0
Tables("设备表").Filter =""
Case Else
Select Case value(0)
Case "按部门","按设备类型"
ls1.AddRange(iif(value(0) = "按部门",vs1,vs2))
For n1 As Integer = 1 To value.Length-1
flt1+=" and " & Ls1(n1-1) & iif(n1=1," like '" & value(n1) & "%'" ," = '" & value(n1) & "'")
Next
Case "按设备标识"
flt1 =" and 设备标识 ='" & e.Node.Text & "'"
End Select
Tables("设备表").Filter = flt1.substring(5)
End Select
[此贴子已经被作者于2012-7-18 13:43:03编辑过]