没看懂楼主的疑问,换成下面这样看看行不。
Dim Filter As String
If e.Node.Text = "加载所有数据" Then
Filter = "[送货完成状态] Is Null"
Else
Dim Value() As String
Value = e.Node.FullPath.Split("\")
Select Case e.Node.Level
Case 0
Filter = "[种类] = '" & Value(0) & "' And [送货完成状态] Is Null"
Case 1
Filter = "[种类] = '" & Value(0) & "' And [客户] = '" & Value(1) & "' And [送货完成状态] Is Null"
End Select
End If
DataTables("mgwork").LoadFilter = Filter
DataTables("mgwork").Load()