I have a tree structure containing nodes and child attributes. Each node has got a unique key as an attribute.I have got the the value of the key and I need to access its parent node using this key.

Please suggest the way to solve this problem.

Regards,
Dinil

Hi,

Try This :

Dim ChNode As Node
Dim ParNode As Node
Set ChNode = TrVw.Nodes("WhateverKey")
Set ParNode = ChNode.Parent

Regards
Veena

Hi ,
Thanks for the reply !

But actually in our code we have the following issue :


Value I have Got : TrVw.Node.NodeKey
Value I need : TrVw.Node

Hi,

In my code, replace the "WhateverKey" with your node key..

Regards
Veena

Hi,
The data type of the variable containing the whole tree structure(as seen in the watch window) is of "Variant" type. Will your code work for the Variant data type? Or is there any other solution?