Dim Filter As String
Dim wtb As WinForm.Table = e.Form.Controls("Table1")'窗口表
Dim dr As DataRow = e.Node.DataRow '获取生成此节点的行
'''目录树是参数表生成,窗口表是流水账表生成,现在不知道前面这句怎么改****
If e.Node.Text <> "显示所有行" Then
Select Case e.Node.Level
Case 0
Filter = "[一级科目] = '" & dr("科目表_一级") & "' or [一级科目] = '" & dr("对方科目_一级") & "'"
Case 1
Filter = "[一级科目] = '" & dr("科目表_一级") & "' or [一级科目] = '" & dr("对方科目_一级") & "' and [二级科目] = '" & dr("科目表_二级") & "' or [二级科目] = '" & dr("对方科目_二级") & "'"
Case 2
Filter = "[一级科目] = '" & dr("科目表_一级") & "' or [一级科目] = '" & dr("对方科目_一级") & "' and [二级科目] = '" & dr("科目表_二级") & "' or [二级科目] = '" & dr("对方科目_二级") & "' and [三级科目] = '" & dr("科目表_三级") & "' or [三级科目] = '" & dr("对方科目_三级") & "'"
End Select
End If
Tables("流水账").Filter = Filter
[此贴子已经被作者于2022/6/24 10:14:42编辑过]