如以下代码,BOM中有许多BOM,我点展开全阶,这样只会显示全部BOM,也就是等于取消筛选而于,如果可以全部展开我想要的BOM
Dim tr As WinForm.TreeView = e.Form.Controls("TreeView2")
Dim nd1 As WinForm.TreeNode = tr.SelectedNode
Dim mj As String = nd1.Text
Dim Parts() As String = mj.Split("|")
Tables("BOM明细_tabbom").Filter ="[父阶代码] = '" & Parts(0) & "'"
If mj = "展开全阶" Then
Tables("BOM明细_tabbom").Filter ="[父阶代码] Is not null " '母件信息显示在当前界面
Else
'统计节点是否涵盖在母件列记录
Dim cnt As Integer
cnt = DataTables("BOM").SQLCompute("Count(*)", "[父阶代码] = '" & Parts(0) & "' ")
'依条件展开查询
If cnt = 0 Then
Tables("BOM明细_tabbom").Filter ="[子阶代码] = '" & Parts(0) & "'"
Else
Tables("BOM明细_tabbom").Filter ="[父阶代码] = '" & Parts(0) & "'"
'母件信息显示在当前界面
End If
End If
Tables("BOM明细_tabbom").AutoSizeCols()