Help With Tree View

Russ9517

Registered User.
Local time
Today, 16:46
Joined
Sep 15, 2006
Messages
30
I've got this code to generate a tree view list box from a recordset but i need to know how to:
On double click chnage to value of a child node and also to know which valve is selected from the list.
Code:
lisPipes.Nodes.Add , , "PON" & rsPipes!Pon, rsPipes!Pon
lisPipes.Nodes.Add "PON" & rsPipes!Pon, tvwChild, "Type" & rsPipes!Pon, "Type: Null"
lisPipes.Nodes.Add "PON" & rsPipes!Pon, tvwChild, "InPack" & rsPipes!Pon, "InPack: Null"
lisPipes.Nodes("Type" & rsPipes!Pon).EngksureVisible
:confused:
Thanks
 
Most ActiveX controls have a double click event, for example:

Code:
Private Sub TreeView_DblClick ()
     do something here
End Sub

however, a more common event used in a treeview control is the NodeClick event, for example:

Code:
Private Sub TreeView_NodeClick(ByVal Node As Object)
     do something here
End Sub

one syntax you can use to identify the selected item is something like:

Code:
Me.Treeview.SelectedItem

another possiblity is probably more common by refering to the node's index or key, for example:

Code:
Me.Treeview.SelectedItem.Key
Me.Treeview.SelectedItem.Index
 

Users who are viewing this thread

Back
Top Bottom