此主题相关图片如下:截图.png
Dim Value()As String
Dim Filter As String
Value = e.Node.FullPath.Split("\")
S e l e c t Case e.Node.Level
Case 0
Filter ="level1Departments = '" & Value(0) & "'"
Case 1
Filter ="level1Departments = '" & Value(0) & "' And level2Departments = '" & Value(1) & "'"
Case 2
Filter ="level1Departments = '" & Value(0) & "' And level2Departments = '" & Value(1) & "' And level3Departments = '" & Value(2) & "'"
Case 3
Filter ="level1Departments = '" & Value(0) & "' And level2Departments = '" & Value(1) & "' And level3Departments = '" & Value(2) & "'And level4Departments = '" & Value(3) & "' "
Case 4
Filter ="level1Departments = '" & Value(0) & "' And level2Departments = '" & Value(1) & "' And level3Departments = '" & Value(2) & "'And level4Departments = '" & Value(3) & "'And level5Departments = '" & Value(4) & "' "
Case 5
Filter ="level1Departments = '" & Value(0) & "' And level2Departments = '" & Value(1) & "' And level3Departments = '" & Value(2) & "'And level4Departments = '" & Value(3) & "' And level5Departments = '" & Value(4) & "' And level6Departments = '" & Value(5) & "' "
End S e l e c t
Tables("窗口1_table1").Fill("S E L E C T * FROM table where isnull (level1Departments,'') = '"& Value(0) &"' and isnull(level2Departments,'') = '"& Value(1) &"' and isnull(level3Departments,'') = '"& Value(2) &"' and isnull(level4Departments,'') = '"& Value(3) &"' and isnull(level5Departments,'') = '"& Value(4) &"'","SALE",True)