Dim tb As Table = e.Form.Controls("Table1").Table Dim Vals() As String = e.Node.FullPath.Split("\") Dim cols() As String = vars("TreeViewStr").Split("|") Dim filter As String = "1=1" If e.Node.Text <> "显示所有行" Then For i As Integer = 0 To vals.Length - 1 filter &= " and " & cols(i) & " = '" & vals(i) & "'" Next End If msgbox(filter) tb.Filter = Filter