Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共11 条记录, 每页显示 10 条, 页签: [1] [2]
[浏览完整版]

标题:多级节点的选择

1楼
g1j2h3 发表于:2024/5/5 15:41:00
麻烦老师下边这段代码错在什么地方,前两行代码可以实现,最后的代码提示没应用到实例
If e.node.parentnode.parentnode IsNot Nothing Then
    vars("发货日期") = e.node.parentnode.parentnode.text & "年" & e.node.parentnode.text & "月" & e.node.text
ElseIf e.node.parentnode IsNot Nothing  
    vars("发货日期") = e.node.parentnode.text & "年" & e.node.text & "月"
Else
    vars("发货日期") = e.node.parentnode.text & "年" 
End If
2楼
有点蓝 发表于:2024/5/5 21:06:00
Else
    vars("发货日期") = e.node.text & "年" 
End If
3楼
g1j2h3 发表于:2024/5/5 21:53:00
用这段代码仍提示”未将对象引用设置到对象的实例“
4楼
有点蓝 发表于:2024/5/5 22:59:00
If e.node.parentnode IsNot Nothing  
If e.node.parentnode.parentnode IsNot Nothing Then
vars("发货日期") = e.node.parentnode.parentnode.text & "年" & e.node.parentnode.text & "月" & e.node.text
else
    vars("发货日期") = e.node.parentnode.text & "年" & e.node.text & "月"
end if
Else
    vars("发货日期") = e.node.parentnode.text & "年" 
End If
5楼
g1j2h3 发表于:2024/5/6 11:10:00
麻烦老师再看看下边代码,总是出现”未将对象引用设置到对象的实例“,问题出在哪里
Dim Filter As String = ""
If e.node.Name <> "显示所有行" Then 
    Dim d1 As Date
    Dim d2 As Date
    Dim Product As String = e.Node.DataRow("客户来源")
    Dim Year As Integer = e.Node.DataRow("年")
    Dim Month As Integer = e.Node.DataRow("月")
    Select Case e.Node.Level
        Case 0
            Filter = " 客户来源 = '" & Product & "'"
        Case 1
            d1 = New Date(Year, 1, 1) '取得该年的第一天
            d2 = New Date(Year, 12, 31) '取得该年的最后一天
            Filter = "客户来源 = '" & Product & "'And 发货日期 >= #" & d1 & "# And 发货日期 <= #" & d2 & "#"
        Case 2
            d1 = New Date(Year, Month, 1) '取得该月的第一天
            d2 = New Date(Year, Month, Date.DaysInMonth(Year, Month)) '取得该月的最后一天
            Filter = "客户来源 = '" & Product & "'And 发货日期 >= #" & d1 & "# And 发货日期 <= #" & d2 & "#" 
    End Select
End If
Tables("发货汇总_table1").Filter = Filter


If e.node.parentnode.parentnode IsNot Nothing Then
    vars("发货日期") = e.node.parentnode.parentnode.text & e.node.parentnode.text & "年" & e.node.text & "月"
Else
    vars("发货日期") = e.node.parentnode.text & e.node.text & "年" 
End If
If e.node.parentnode IsNot Nothing Then
    vars("发货日期") = e.node.parentnode.text 
End If
6楼
有点蓝 发表于:2024/5/6 11:11:00
麻烦按4楼的改
7楼
g1j2h3 发表于:2024/5/6 11:16:00
按4楼的改完后,仍出现提示

8楼
有点蓝 发表于:2024/5/6 11:22:00
请上传实例测试
9楼
g1j2h3 发表于:2024/5/6 11:32:00
如果选择客户来源——年——月或者选择客户来源——年都没问题,只是单独点客户来源就会出现提示,现在是如何单独选择客户来源时不出现提示
10楼
g1j2h3 发表于:2024/5/6 11:33:00
实例已应用在工作中,不便上传,请老师理解

共11 条记录, 每页显示 10 条, 页签: [1] [2]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03223 s, 2 queries.