Solved

ActiveX Tree Control

Posted on 1998-08-15
3
249 Views
Last Modified: 2006-11-17
I'm trying to get data from several queries onto one display, and would like to present all of the data on a tree control. Right now, I can't even figure out how to populate the tree, and online help has not been of any assistance. I'm left with what seems to be a big, blank, textbox. Can anyone please give me a little help, or give me a url of a place that can be of some assistance? Thank you.
0
Comment
Question by:behrang
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
tuvi earned 100 total points
ID: 1959290
You use the control's Nodes property which is itself a Nodes collection. The Nodes collection have the Add method to add object to it. Refer to online help for the syntax.
0
 

Author Comment

by:behrang
ID: 1959291
The only help of syntax that I found where .root, .parent, etc. Am I on the right track?
0
 
LVL 5

Expert Comment

by:tuvi
ID: 1959292
I know it is tough to get into the right help topic involving ActiveX control (blame it on Microsoft). Anyway, this is how I get to the right topic:

Put your cursor on the Style property of the Treeview control. Press F1. The Help on Style Property will display on screen. Now click on Applies To and choose Node Object / Nodes Collection. You now have the help on the Nodes Collection. Click on Methods and choose Add Method (Nodes Collection). And there you have the right help on the Add syntax.

Here is my example of how you use the Add method to your control. I name the TreeView control as "ctTree".

Private Sub Form_Load()
  Dim colNodes As Nodes
  Dim curNode As Node
 
  Set colNodes = ctTree.Nodes
  colNodes.Add , tvwFirst, "Root", "The Root"
  colNodes.Add "Root", tvwChild, "FirstRootChild", "First Level / First Item"
  colNodes.Add "Root", tvwChild, "SecondRootChild", "First Level / Second Item"
  colNodes.Add "FirstRootChild", tvwChild, "FirstRootChild-1", "Second Level"
End Sub
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now