Foxtable(狐表)用户栏目专家坐堂 → 执行以下目录树代码,只执行品名,供应商,采购日期执行不了。报错找不到


  共有3410人关注过本帖树形打印复制链接

主题:执行以下目录树代码,只执行品名,供应商,采购日期执行不了。报错找不到

帅哥哟,离线,有人找我吗?
lgz518
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1257 积分:8555 威望:0 精华:0 注册:2019/6/13 9:57:00
执行以下目录树代码,只执行品名,供应商,采购日期执行不了。报错找不到  发帖心情 Post By:2019/7/29 16:24:00 [显示全部帖子]

 执行以下目录树代码,只执行品名,供应商,采购日期执行不了。报错找不到

e.Form.Controls("TreeView1").BuildTree("采购单", "品名|供应商|采购日期")



Dim nms As String() = {"品名","供应商","日期"} '指定生成目录树的各列
Dim qts As String() = {"'","","#"} '指定将各列的值括起来的符号


'Dim nms As String() = {"产品","客户","雇员"} '指定生成目录树的各列
'Dim qts As String() = {"'","'","'"} '指定将各列的值括起来的符号,这里都是字符型,所以都是单引号
Dim trv As WinForm.TreeView = e.Sender
Dim flt As String
Dim nd As WinForm.TreeNode
For Each nd In e.node.allNodes '清除子节点的选中标记
    nd.Checked = False
Next
nd = e.Node.ParentNode
Do While nd IsNot Nothing '清除父节点的选中标记
    nd.Checked = False
    nd = nd.ParentNode
Loop
For Each nd In trv.AllNodes
    If nd.Checked  Then
        Dim rts() As String = nd.FullPath.Split("\")
        Dim val As String = ""
        For i As Integer = 0 To rts.length - 1
            If val > "" Then
                val = val & " And "
            End If
            val = val & nms(i) & " = " & qts(i) & rts(i) & qts(i)
        Next
        If flt > "" Then
            flt = flt & " Or (" & val & ")"
        Else
            flt = val
        End If
    End If
Next
Tables("采购单").Filter  = flt

 回到顶部