Rss & SiteMap

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

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

标题:[求助]目录树统计提示找不到列

1楼
wudishaoshuai 发表于:2024/4/2 11:59:00
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree(gt, "年|月|日|分类|部件")
trv.StopRedraw
For Each nd As WinForm.TreeNode In trv.AllNodes
    Dim Year As Integer = nd.DataRow("年")
    Dim Month As Integer = nd.DataRow("月")
    Dim Day As Integer = nd.DataRow("日")
    Dim type As String = nd.DataRow("分类")
    Dim component As String = nd.DataRow("部件")
    Select Case nd.Level
        Case 0
            nd.Text = nd.text & "年(" & gt.Compute("Sum(数量)", "年 = " & Year) & "个)"
        Case 1
            nd.Text = nd.text & "月(" & gt.Compute("Sum(数量)", "年 = " & Year & " And 月 = " & Month) & "个)"
        Case 2
            nd.Text = nd.text & "日(" & gt.Compute("Sum(数量)", "年 = " & Year & " And 月 = " & Month & " And 日 = " & Day) & "个)"
        Case 3
            nd.Text = nd.text & "日(" & gt.Compute("Sum(数量)", "年 = " & Year & " And 月 = " & Month & " And 日 = " & Day & " And 分类 = " & type) & "个)"
        Case 4
            nd.Text = nd.text & "(" & gt.Compute("Sum(数量)", "年 = " & Year & " And 月 = " & Month & " And 日 = " & Day) & "个)" 
    End Select
Next
trv.Nodes.Insert("[显示所有行]", "显示所有行(" & Val(gt.Compute("Sum(数量)")) & "个)", 0)
trv.ResumeRedraw

代码如上,点击case3的时候提示找不到列,前面1,2都可以,是case3的后面的条件写错了吗
2楼
有点蓝 发表于:2024/4/2 13:33:00
参考:http://www.foxtable.com/webhelp/topics/1284.htm

Case 3
            nd.Text = nd.text & "日(" & gt.Compute("Sum(数量)", "年 = " & Year & " And 月 = " & Month & " And 日 = " & Day & " And 分类 = '" & type & "'") & "个)"
共2 条记录, 每页显示 10 条, 页签: [1]

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

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