treeview help needed

J

JohnE

Hello. I have a main form that has a treeview (parent and child) on it and a
tab control with subforms and textboxes. The treeview control works and
displays just what is needed. But, I am lost as to how to make a record
appear on the tab control when a child in the treeview is selected. I have
used a combobox or listbox after update event in the past to have the
selected record information displayed. Need to get the treeview child
selection to do the same.
Can anyone help out on this or point me in the right direction to a
sample/example?
Thanks... John
 
S

Stuart McCall

JohnE said:
Hello. I have a main form that has a treeview (parent and child) on it
and a
tab control with subforms and textboxes. The treeview control works and
displays just what is needed. But, I am lost as to how to make a record
appear on the tab control when a child in the treeview is selected. I
have
used a combobox or listbox after update event in the past to have the
selected record information displayed. Need to get the treeview child
selection to do the same.
Can anyone help out on this or point me in the right direction to a
sample/example?
Thanks... John

Use the Treeview's NodeClick event and refer to Node.Text to obtain the
value to filter the form to the correct record. Something like:

Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
Me.Filter = "MyFieldName = '" & Treeview1.Text & "'"
Me.FilterOn = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

treeview and listview 3
Strange treeview behavior, A2007 0
treeview double click event 1
treeview ActiveX control 1
TreeView and Infopath 0
Add Child Node to Treeview 5
Treeview 4
Treeview Control (v6.0) MSCtrlLib 4

Top