以文本方式查看主题

-  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=66552)

--  作者:新航程小何
--  发布时间:2015/4/9 11:59:00
--  统计表的目录树筛选问题

各位老师,请问我的问题到底出哪了?问题在截图(我设计表里有“年”,“月”)

Dim Filter As String

Dim y As String = e.Node.DataRow("年")
Dim m As String = e.Node.DataRow("月")
Dim lx1 As String = e.Node.DataRow("产品类型")
Dim cp1 As String = e.Node.DataRow("产品名称")

If Tables("产品库管理记录_table1").DataTable.name="统计表1" Then
    If e.node.Name <> "显示全部 " Then
        Select Case e.Node.Level
            Case 0
                Filter = "年 = \'" & y & "\'"
            Case 1
                Filter = "年 = \'" & y & "\' and 月 = \'" & m & "\'"
            Case 2
                Filter = "年 = \'" & y & "\' and 月 = \'" & m & "\' and 产品类型= \'" & lx1 & "\'"
            Case 3
                Filter = "年 = \'" & y & "\' and 月 = \'" & m & "\' and 产品类型= \'" & lx1 & "\' and  产品名称=\'" & cp1 & "\'"
        End Select
    End If

end If

Tables("产品库管理记录_table1").Filter = Filter

我的表里面也没有“产品种类”


图片点击可在新窗口打开查看此主题相关图片如下:qq截图20150409114517.png
图片点击可在新窗口打开查看
[此贴子已经被作者于2015/4/9 11:59:28编辑过]

--  作者:Bin
--  发布时间:2015/4/9 12:01:00
--  
messagebox.show(Filter)

弹出条件看一下

--  作者:狐狸爸爸
--  发布时间:2015/4/9 12:14:00
--  

学会调试:

http://www.foxtable.com/help/topics/1485.htm

 

这样遇到问题,可以很快找出出错的代码,知道那一行出错,大概也就知道原因了