Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / February 2006

Tip: Looking for answers? Try searching our database.

Populate TreeView With Query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JamesJ - 06 Feb 2006 00:47 GMT
Hi. So far I've used the following to populate a treview control

Private Sub Form_Load()

 Dim nodX As Node

    Set nodX = TreeView1.Nodes.Add(, , "r2", "Contact Types")
       nodX.Expanded = True

       Set nodX = TreeView1.Nodes.Add("r2", tvwChild, "child1",
"Audio/Video")
       Set nodX = TreeView1.Nodes.Add("r2", tvwChild, "child2", "Auto
Care")
       Set nodX = TreeView1.Nodes.Add("r2", tvwChild, "child3", "Bills")
       Set nodX = TreeView1.Nodes.Add("r2", tvwChild, "child4", "Computer")
       Set nodX = TreeView1.Nodes.Add("r2", tvwChild, "child5",
"Financial")
       Set nodX = TreeView1.Nodes.Add("r2", tvwChild, "child6",
"Government")
       Set nodX = TreeView1.Nodes.Add("r2", tvwChild, "child7", "Home
Improvement")

End Sub

Instead of setting each child to text I want to use a table (tblContactType)
that
has the Contact Types already stored.

Thanks,
James
Douglas J. Steele - 06 Feb 2006 01:52 GMT
Unforunately, you can't. The TreeView control isn't databound. You have to
add the data manually, as you are.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> Hi. So far I've used the following to populate a treview control
>
[quoted text clipped - 27 lines]
> Thanks,
> James
Alex Dybenko - 06 Feb 2006 10:18 GMT
Hi,
you can also look at this sample:
http://www.pointltd.com/Downloads/Details.asp?dlID=36

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

> Hi. So far I've used the following to populate a treview control
>
[quoted text clipped - 27 lines]
> Thanks,
> James
Mark Johnson - 06 Feb 2006 10:28 GMT
>Instead of setting each child to text I want to use a table (tblContactType)
>that
>has the Contact Types already stored.

You're doing it right, using Add. As Doug said, the treeview is filled
programmatically.

See this for a more complete example:
http://scenic-route.com/program/vb/ax1.htm

and links on page 5.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.