以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  求助帅选树问题?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=172136)

--  作者:xnsiwei
--  发布时间:2021/9/25 17:40:00
--  求助帅选树问题?
求助帅选树问题?

AfterCheckNode

改变节点复选框状态后执行。

代码如下,编译总是过不去,错误提示:未声明牵头单位

Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim flt As String
For Each nd As WinForm.TreeNode In e.node.Nodes
    nd.Checked = False
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.Checked Then
        If flt > "" Then
            Flt = flt & " Or "
        End If
        Select Case nd.Level
            Case 0
                flt = flt & "案件类别 = \'" & nd.DataRow("案件类别") & "\'"
            Case 1
                flt = flt & "案件类别 = \'" & nd.DataRow("案件类别") & "\'" And 牵头单位 = \'" & nd.DataRow("牵头单位") & "\'"
        End Select
    End If
Next
Tables("案件办理").filter = flt

--  作者:有点蓝
--  发布时间:2021/9/25 17:47:00
--  
 flt = flt & "案件类别 = \'" & nd.DataRow("案件类别") & "\' And 牵头单位 = \'" & nd.DataRow("牵头单位") & "\'"