Dim tv1 As WinForm.TreeView
tv1 =e.Form.Controls("TreeView1")
tv1.BuildTree("预算汇总","年份|月份|部门")
tv1.Nodes.Insert("刷新",0)
tv1.Nodes.Insert("显示所有行",1)
Dim dr As DataRow = e.Node.DataRow \'获取生成此节点的行
If e.Node.Text <> "显示所有行" Then
Select Case e.Node.Level
Case 0
Filter = "[年份] = \'" & dr("年份") & "\'"
Case 1
Filter = "[年份] = \'" & dr("年份") & "\' And [月份] = \'" & dr("月份") & "\'"
Case 2
Filter = "[年份] = \'" & dr("年份") & "\' And [月份] = \'" & dr("月份") & "\' And [部门] = \'" & dr("部门") & "\'"
End Select
End If
Tables("预算汇总").Filter = Filter
If e.Node.Text = "刷新" Then
Dim tv1 As WinForm.TreeView
tv1 =e.Form.Controls("TreeView1")
tv1.BuildTree("预算汇总","年份|月份|部门")
tv1.Nodes.Insert("显示所有行",0)
tv1.Nodes.Insert("刷新",0)
End If