Results 1 to 8 of 8
  1. #1
    Trial4life is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2022
    Posts
    33

    How to create an interactive TreeView

    Hi everyone,
    I'm struggling with the creation of an interactive Treeview.

    I've read that the default TreeView control of MS Accesss doesn't work very well on a 64 bit OS.

    I've made some tests, and I was able to populate the TreeView, but I get some errors when trying to use the "NodeCheck" event in order to perform certain actions when checking the nodes.



    I've found another solution on this website:
    https://jkp-ads.com/articles/treeview.asp

    These are the functionalities that I'm trying to achieve:
    • Add the TreeView on my User Form;
    • Auto-populate the TreeView with nodes (with checkboxes) when the form loads, getting the data from a table;
    • If the a parent checkbox is checked/unchecked, all the child nodes get checked/unchecked;
    • Whenever the user checks a checkbox, filter one field of the form main Recordset using the names of the checked node plus all of the names of the child nodes;
    • Add/remove nodes using the user-interface (adding automatically the records to the table);


    Is it possible to do all of this stuff with the default TreeView control of MS Access, or do I have to use the classes found on the website I've linked above?

    Thanks in advance for the help.

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    I would point you to posts by MajP on another Access forum
    https://www.access-programmers.co.uk...-class.309753/

    Lots of treeview stuff here, and all well written.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    My advice it NOT to use treeview. It requires programming when you need to make changes.

    Use a form with filters to see data
    or
    the Switchboard if you want menu items. Switchboard is updated with table values, not programming.

  4. #4
    Trial4life is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2022
    Posts
    33
    Then thing is that the records that I'm trying to store have complex relations and a treeview would help a lot in finding matches, I can't find a better solution...

  5. #5
    Edgar is online now Competent Performer
    Windows 8 Access 2016
    Join Date
    Dec 2022
    Posts
    271
    Finding matches? you want to visualize matches with a treeview control? you mean you're doing that by hand?

    I use a lot of interfaces in several different platforms every day and only the oldest ones use the ancient treeview control. Most times, a breadcrumb control is much better, occupies less space and you can make one easily by simply storing the entire path and possibly a button to go "up" or "back". What is your database about and what do you want to do?

  6. #6
    Trial4life is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2022
    Posts
    33
    I needed the treeview to "visually" filter the Recordset of the main form, searching for the matches of the node names with the categories names stored in a column of the Recordset.

    After a couple of days of coding, I actually managed to achieve what I needed.

    This is the tutorial that I started with:
    https://www.youtube.com/watch?v=l7jCSMRpM6s

    It's a pretty old method, as you've already mentioned, but it did help me get the job done.

  7. #7
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    Did you look at the link I provided.
    @MajP has done extensive work on recursive tree structures, and I'm sure it would have helped.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  8. #8
    Edgar is online now Competent Performer
    Windows 8 Access 2016
    Join Date
    Dec 2022
    Posts
    271
    I see. Initially, I was having difficulty visualizing your specific use case, as even though there are some instances where treeviews are the most appropriate choice, upon reading about your project's need for "matches", I quickly misjudged that a treeview was a bad idea. But it's cool you figured it out.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Interactive form
    By Jishnu Surendran in forum Forms
    Replies: 5
    Last Post: 03-19-2018, 10:57 PM
  2. Interactive map of 1000 seats
    By chacham in forum Forms
    Replies: 20
    Last Post: 12-28-2017, 12:04 PM
  3. Interactive Form for survey
    By Canadiangal in forum Access
    Replies: 4
    Last Post: 06-21-2017, 06:26 AM
  4. Replies: 1
    Last Post: 09-16-2013, 07:20 PM
  5. Interactive Training sugguestion
    By dstone8484 in forum Access
    Replies: 5
    Last Post: 07-06-2010, 07:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums