masoud_sedighy
Registered User.
- Local time
- Yesterday, 16:27
- Joined
- Dec 10, 2011
- Messages
- 132
in my tree view I want when select each node it shows data in the list box of right panel. Child nodes have specific query related to its parent. Now I want when selectedNode.Parent.Parent="test packs" If selectedNode.Parent.Parent = "test packs" Then It shows related data so I did like below code and it was ok. And when select "test packs" it should show related data or specific query related to this node.
But when selected node is "test packs" or "root node" because there is no
.Parent.Parent for "test packs" and parent of that is "root node"
(selectedNode.Parent.Parent) I received error code 91 , please help how I can solve this problem.
[edited by gemma-the-husky to display the code within code tags]
But when selected node is "test packs" or "root node" because there is no
.Parent.Parent for "test packs" and parent of that is "root node"
(selectedNode.Parent.Parent) I received error code 91 , please help how I can solve this problem.
Code:
Private Sub TreeView_NodeClick(ByVal selectedNode As Object)
On Error GoTo Error_Trap
Dim frm As Access.Form
Dim frm2 As Access.Form
Dim strNodeText As String
Dim strTitlePlus As String
Set frm = Me![fsubItem].Form
If selectedNode.Parent.Parent.Parent = "test packs" Then
strNodeText = selectedNode.Text
Me![txtSelectedDoc].Value = strNodeText
frm![ItemList].RowSource = "qryTestPack_line"
frm.Requery frm.ItemList.Requery
frm.Visible = True
Else
frm![ItemList].RowSource = "qryTestPackage"
frm.Requery frm.ItemList.Requery
frm.Visible = True
End If
[edited by gemma-the-husky to display the code within code tags]
Last edited by a moderator: