以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]如何筛选窗口中表的数据?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=103011)

--  作者:hrw68529
--  发布时间:2017/6/29 9:10:00
--  [求助]如何筛选窗口中表的数据?
如下代码,如何筛选窗口表中的数据。如果窗口中的表为:劳动能力鉴定_鉴定,修改后,提示filter不是datatable表属性,怎么改代码
Dim trv As WinForm.TreeView = e.Sender
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 "  \'注意用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
Tables("劳动能力鉴定").Filter = flt  
[此贴子已经被作者于2017/6/29 9:12:10编辑过]

--  作者:hrw68529
--  发布时间:2017/6/29 9:34:00
--  
将Tables("劳动能力鉴定").Filter = flt  改为:Tables("劳动能力鉴定_鉴定").Filter = flt  
也不行

--  作者:有点色
--  发布时间:2017/6/29 9:46:00
--  

应该是你表别的事件影响了吧?比如currentChanged等。

 

试试

 

SystemReady = False

e.Form.Controls("Table1").Table.Filter = flt

SystemReady = True