以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  想要目录树前两级节点双击不加载数据  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=80222)

--  作者:erdbeer
--  发布时间:2016/1/18 23:08:00
--  想要目录树前两级节点双击不加载数据

Dim dr As DataRow = e.Node.DataRow

Dim Filter As String
Dim Year As Integer = dr("年")
Dim Month As Integer = dr("月")
Dim Product As String =Right(dr("号码"),15)

 

Select Case e.Node.Level
    Case 0
          Filter = "[_Identify] is null"         
    Case 1
         
Filter = "[_Identify] is null"

    Case 2
          Filter ="Year(订单日期) = " & Year & " And Month(订单日期) = " & Month & " And 订单号码 = \'" & Product & "\'"

End Select
DataTables("订单明细").LoadFilter = Filter
DataTables("订单明细").Load()

 

窗口的目录树双击代码如上,在双击第一级和第二级节点的时候,有报错 Invalid parameters for Select method.  ,  第三级节点正常

该怎么改? 我的要求是,前面两级节点双击后,不加载数据


--  作者:大红袍
--  发布时间:2016/1/18 23:33:00
--  

Dim dr As DataRow = e.Node.DataRow

Dim Filter As String
Dim Year As Integer = dr("年")
Dim Month As Integer = dr("月")
Dim Product As String =Right(dr("号码"),15)

 

Select Case e.Node.Level
    Case 0
       
    Case 1
       
    Case 2
        Filter ="Year(订单日期) = " & Year & " And Month(订单日期) = " & Month & " And 订单号码 = \'" & Product & "\'"
        DataTables("订单明细").LoadFilter = Filter
        DataTables("订单明细").Load()
End Select