Solved

ActiveX Tree Control

Posted on 1998-08-15
3
263 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access 2016 7 33
Top 1 of each supplier 55 55
Dcount using a date in a table compared to today's date 3 28
Create report using crosstab query 11 29
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

813 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