"Oliver" <ol******@mailinator.com> wrote in message
news:24**************************@posting.google.c om...
I have seen mention of TreeView controls in other threads, but cannot
find information about these in the Online Help. I feel that I might
be missing out on some useful functionality. How can I access this
(and any other) extra controls, and how can I learn about them?
I use Access 2000 and Access 97.
Thank you,
Oliver
Access developers who work with the treeview control often have MS Office
Developer's edition which comes with a licence to work with this control.
Without it, you will not be able to insert this control into your forms. An
example of how it works can be seen below:
Create a new blank form and show it in design mode. From your toolbox
select the 'more controls' button which should be the last. Scroll down and
select Microsoft Treeview Control and place one on your form. Name the
control 'ctlTreeView'. Then paste the following code into the form's
module:
Option Compare Database
Option Explicit
Private Sub Form_Load()
Dim tvw As MSComctlLib.TreeView
Dim nod As MSComctlLib.Node
Set tvw = Me.ctlTreeView.Object
Set nod = tvw.Nodes.Add(, , "000-000", "National Characteristics")
Set nod = tvw.Nodes.Add("000-000", tvwChild, "100-100", "Australian")
Set nod = tvw.Nodes.Add("100-100", tvwChild, "100-101", "violently loud")
Set nod = tvw.Nodes.Add("100-100", tvwChild, "100-102", "alcoholic")
Set nod = tvw.Nodes.Add("100-100", tvwChild, "100-103", "rough necks")
Set nod = tvw.Nodes.Add("000-000", tvwChild, "100-200", "English")
Set nod = tvw.Nodes.Add("100-200", tvwChild, "100-201", "cold-blooded
queers")
Set nod = tvw.Nodes.Add("100-200", tvwChild, "100-202", "nasty complexions")
Set nod = tvw.Nodes.Add("100-200", tvwChild, "100-203", "terrible teeth")
Set nod = tvw.Nodes.Add("000-000", tvwChild, "100-300", "Russian")
Set nod = tvw.Nodes.Add("100-300", tvwChild, "100-301", "brutish")
Set nod = tvw.Nodes.Add("100-300", tvwChild, "100-302", "dumpy")
Set nod = tvw.Nodes.Add("100-300", tvwChild, "100-303", "boorish")
Set nod = tvw.Nodes.Add("000-000", tvwChild, "100-400", "Swedish")
Set nod = tvw.Nodes.Add("100-400", tvwChild, "100-401", "tedious")
Set nod = tvw.Nodes.Add("100-400", tvwChild, "100-402", "clean-living")
Set nod = tvw.Nodes.Add("100-400", tvwChild, "100-403", "boy scout types")
Set nod = Nothing
Set tvw = Nothing
End Sub
HTH
Tom