以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]查询时,让他们同步显示  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=93095)

--  作者:GD007
--  发布时间:2016/11/20 16:00:00
--  [求助]查询时,让他们同步显示
如图
图片点击可在新窗口打开查看此主题相关图片如下:qq截图20161120155155.png
图片点击可在新窗口打开查看
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目1.rar



--  作者:有点青
--  发布时间:2016/11/20 18:16:00
--  
Dim trv As WinForm.TreeView = e.Sender
Dim flt 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
For Each nd As WinForm.TreeNode In trv.AllNodes
    If nd.Level > 0 AndAlso nd.ParentNode.Checked Then \'如果父节点选中
        Continue For \'跳过此节点,处理下一结点
    End If
    If nd.Checked Then
        If flt > "" Then
            flt = flt & " Or "  \'注意用or而不是And
        End If
        If nd.Level = 0 Then \'注意下面的条件都要用括号括起来
            flt = flt & "( 入职部门 = \'" & nd.Text & "\')"
        Else
            flt = flt & "( 入职部门 = \'" & nd.ParentNode.Text & "\' And 姓名 = \'" & nd.Text & "\')"
        End If
    End If
Next
e.Form.controls("table1").Table.Filter = flt
e.Form.controls("table2").Table.Filter = flt
e.Form.controls("table3").Table.Filter = flt