Private Sub TreeView_NodeClick(ByVal Node As Object)
Dim str As String
'定义要筛选的名称
Select Case 车间.Caption
Case "车间"
str = "[车间名称]='" & Node.Text & "'"
Case "部门"
If Node.Key = "爷" Or Node.Key Like "父*" Or Node.Key Like "子*" Then
str = ""
Else
str = "[部门名称]='" & Node.Text & "'And [车间名称]='" & Node.Parent & "'"
End If
Private Sub TreeView_NodeClick(ByVal Node As Object)
Dim str As String
'定义要筛选的名称
If Node.Key = "爷" Or Node.Key Like "父*" Or Node.Key Like "子*" Then
str = ""
If Me![选择] = 1 Or Me![选择] = 2 Then
str = "[部门名称]='" & Node.text & "'"
Else
str = "[车间名称]='" & Node.text & "'"
End If
Me.资料浏览_子窗体.Form.FilterOn = True
Me.资料浏览_子窗体.Form.Filter = str
If Node.Key = "爷" Or Node.Key Like "父*" Or Node.Key Like "子*" Then
str = ""
Else
str = "[部门名称]='" & Node.Text & "'And [车间名称]='" & Node.Parent & "'"
End If