Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use Treeview control 6.0 in access 2000

Status
Not open for further replies.

at51178

Technical User
Mar 25, 2002
587
US
Hey Guys I have looked everywhere on the web for this one
I am trying to find out a way to populate my treeview control which is located on my form.
Please Help

Thank You
 
Try this piece of code to start you off building your own treeview control (if you still haven't):

Option Compare Database
Option Explicit

Private Sub Form_Load()

Dim ndTop As MSComctlLib.Node
Dim nd As MSComctlLib.Node

With Me.tvwOne.Nodes 'TreeView
.Clear
Set ndTop = .Add(, , , "Trial")
ndTop.Expanded = True
Set nd = .Add(ndTop.Index, tvwChild, , "NextLevel")
nd.Expanded = True
Set nd = .Add(ndTop.Index, tvwChild, , "NextSibling")
nd.Expanded = True
Set nd = .Add(nd.Index, tvwChild, , "NextChild")
nd.Expanded = True
nd.ForeColor = vbBlue
End With
End Sub

Private Sub tvwOne_NodeClick(ByVal Node As Object)
Msgbox Node.Text
End Sub

..cheers!
 
Thanks for the reply but I have my form set up already but by looking at this code you did give me some ideas about changing the forecolor.
I am at work now but I will fool around with it when I get a chance.
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top