以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  目录树双击不能筛选 请教!  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=120903)

--  作者:visoni
--  发布时间:2018/6/26 9:15:00
--  目录树双击不能筛选 请教!

WL  为物料表

LB 为物料表内类别字段

已形成目录树如图

双击目录树 但不能执行筛选

 

请老师帮我看看问题出在那里

------------------

目录树的NodeMouseDoubleClick事件代码:

Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim key As String = e.Node.Name
Dim ids As String
If key = "全部" Then
    Tables("WL").Filter = ""
Else
    For Each nd As WinForm.TreeNode In trv.AllNodes
        Dim pd As WinForm.TreeNode = nd
        Do
            If pd.Name = key Then
                If ids > "" Then
                    ids= ids &  ","
                End If
                ids = ids & "\'" & nd.name & "\'"
                Exit Do
            Else
                pd = pd.ParentNode
                If pd Is Nothing Then
                    Exit Do
                End If
            End If
        Loop
    Next
    Tables("WL").Filter = "LB In (" & ids & ")"
End If

------------------

 


图片点击可在新窗口打开查看此主题相关图片如下:180626.jpg
图片点击可在新窗口打开查看
[此贴子已经被作者于2018/6/26 9:16:45编辑过]

--  作者:有点甜
--  发布时间:2018/6/26 9:44:00
--  

加入代码 msgbox(ids) 看弹出什么。

 

如果自己不会调试,上传具体项目。


--  作者:visoni
--  发布时间:2018/6/26 10:55:00
--  

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:newpoint.rar

老师这是项目文件 帮看一下


--  作者:有点甜
--  发布时间:2018/6/26 11:04:00
--  
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim key As String = e.Node.Name
Dim ids As String
If key = "全部" Then
    e.Form.controls("Table1").Table.Filter = ""
Else
    For Each nd As WinForm.TreeNode In trv.AllNodes
        Dim pd As WinForm.TreeNode = nd
        Do
            If pd.Name = key Then
                If ids > "" Then
                    ids= ids &  ","
                End If
                ids = ids & "\'" & nd.name & "\'"
                Exit Do
            Else
                pd = pd.ParentNode
                If pd Is Nothing Then
                    Exit Do
                End If
            End If
        Loop
    Next
    e.Form.controls("Table1").Table.Filter = "LB In (" & ids & ")"
End If

--  作者:visoni
--  发布时间:2018/6/26 11:49:00
--  

老师! 谢谢! 

 

----

e.Form.controls("Table1").Table.Filter = ""

[此贴子已经被作者于2018/6/26 11:52:35编辑过]