Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ActiveX Tree Control

Posted on 1998-08-15
3
Medium Priority
?
302 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
tuvi earned 300 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

618 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