Access Treeview Tutorial Part 1 – Loading data

The Treeview is a great free part of the Microsoft Common Control Library that lets you create your own Treeview and tie your own data and events into the Treeview. It can present a lot of information in a limited space, and allows a lot more versatility in presenting your information. Combine this with the ability to use small icons for each individual record, you get maximum structure on data presentation.

This is part 1 in a series on how to use the treeview in Access.

This first video demonstrates how to add a Treeview into your form, and how to load information into it. Its all very basic, explained and coded from scratch, with detailed explanations. Later I will upload more advanced guides on the same topic, but this is intended to be a very easy getting started guide.

5 Replies to “Access Treeview Tutorial Part 1 – Loading data”

  1. Good morning,

    I have followed your post with interest but I am unable to get the TreeView to work because the references in VBA don’t include the MS Windows Common Controls reference any more (I am using Office 2016). And I am getting a run time error.

    I have registered the MSCOMCTL.OCX files correctly but to no avail.

    Any help or link to resolve this would be appreciated.

    Many thanks

    Agustí

      1. Thanks for your reply.

        When I debug and compile the VBA project I get the following Compile Error:

        User-defined type not defined.

        This refers to the tv variable declaration where it is defined as MSComctlLib.TreeView.

        Normally I have resolved issues like this by loading the relevant library through Tools > References.

        However, I can’t find the reference MS Windows Common Controls in the list of references.

        If I use an older 32 bit version of Access the reference is there and the treeview loads fine.

        I have done some research on the Internet but I can’t find a solution. I imagine that Access 2016 64bit must have a similar reference library to get the treeview to work.

        I hope this helps. Please let me know if you need any further information from me.

        Agustí

        1. I will admit, I can no longer keep track of the circus which is Office versioning. Office 365 includes an update mscomctrl library which supports 64 bit.
          I don’t recall if there is a version that works in 2016 64 bit. I know that I’ve used 32 bit in 2016.

Leave a Reply

Your email address will not be published. Required fields are marked *