Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Dubai, UAE, United Arab Emirates
    Thanked 0 Times in 0 Posts

    TreeView properties in VBE (Access 03)

    G'day All

    I'm playing with the Treeview control and a table with nested records at the moment. I've been searching through the lounge for info on the treeview control and digesting through it.

    For now, my needs are simple: Is there a way to get the VBE to bring up the available properties and methods for a treeview control?

    I have a form with a treeview contrl on it, TVW.

    I have begun my code like the sample below. As I type a reference to the control on the form, then hit . I expect a list of properties to come up - but the Add one isn't amongst them. Same goes with the declared variable tvNode - there are a list of properties, but no Add. Yet when I type Add and use values that I know should work - they do.

    It's frustrating trying to understand something when only half the information is available.

    Any ideas?

    Private Sub SelectTask_AfterUpdate()
    Dim MyDB As Database, TaskSet As Recordset
    Dim tvNode As MSComctlLib.Node
    Dim tvRoot As MSComctlLib.Node

    ..Set MyDB = CurrentDb

  2. #2
    Bronze Lounger
    Join Date
    Nov 2001
    Arlington, Virginia, USA
    Thanked 3 Times in 3 Posts

    Re: TreeView properties in VBE (Access 03)

    I don't use the TreeView control much, but you should be able to use early binding & use "Intellisense" to facilitate using the control's properties & methods. When I added a TreeView control to a form from the ActiveX controls menu, a reference was set to MS Windows Common Controls 6.0 (SP6) (MSCOMCTL.OCX). In code module I was able to use Intellisense with TreeView and Node objects. See attached illustration. NOTE: Am using Access 2002/Windows XP so may or may not be using same version of TreeView control.

    Attached Images Attached Images

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Sacramento, California, USA
    Thanked 1 Time in 1 Post

    Re: TreeView properties in VBE (Access 03)

    That's a problem with pretty much all ActiveX controls. If you right click the control, you'll see TreeCtl Object on the context menu. That will take you to a dialog that lets you set some of the properties of the treeview. Looking up Treeview in the object browser will lead you to an entry for MS common control, which is the parent object for the Treeview. Selecting that will show you a list of methods and properties, but many simple methods aren't listed, especially those that are methods of child objects of the activex control. There are also some standard basic methods of certain kinds of objects that always apply. Add is a standard method of a collection.

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Evergreen, CO, USA
    Thanked 65 Times in 64 Posts

    Re: TreeView properties in VBE (Access 03)

    We've used the Microsoft treeview a fair bit, and it is pretty solid. Mark and Charlotte have noted some of the aspects of development using it, but there are at lease of a couple of other issues you should be aware of.

    One of those is the version of mscomctl.ocx that is used. We seen a number of cases where we had an earlier or later version of the software (than the one it was developed using) installed by some other application that caused things to stop working. If you are planning to deploy something to a number of client PCs, you may want to think about that issue. And it will affect you even if you leave the front-end on the workstation (unless you point the reference to a common location on a server - which can slow performance).

    The other issue has to do with the number of nodes being created. The MS version works fine with up to 50 or 100 nodes, but if you are building a list of a thousand or more nodes, there are appreciable delays in building the tree, and also with clearing it before rebuilding it. In a situation with several thousand nodes, it can take upwards of 15 or 20 seconds, even on a fast PC. If you end up looking at that situation, you want want to consider a third-party ActiveX treeview control.

    All that aside, we think the treeview is a very powerful tool as a part of the user interface, and we use it frequently.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts