参考:
Private Sub TreeView_NodeClick(ByVal Node As Object)
Dim a
a = Right(Node.Key, Len(Node.Key) - 1)
Select Case Left(Node.Key, 1)
Case "D"
Str = "select * from a已用代码 where 名称 = '" & Node & "' ORDER BY 代码"
List6.RowSource = Str
Case Else
Str = "select * from a已用代码 where 代码 like '" & a & "*' ORDER BY 代码"
List6.RowSource = Str
Me.出入库摘要子窗体.Form.Filter = "[代码] like '" & a & "*'"
Me.出入库摘要子窗体.Form.FilterOn = True
End Select
End Sub