Treeview in MS Access Part 5 – Right Click popup menu

Introduction

This blog post is about how to use implement right click options for the treeview, so the user will be presented with options when right clicking a node or empty space in the treeview.

 

The video

As usual I have created a youtube video which shows all steps required. Hope you will like it.

 

 Downloads

You can download the sample DB here:

2007 format:

Download “Treeview Tutorial Part 5 (2007 format)” TreeviewDemoPart5Access2007.zip – Downloaded 1028 times – 83 KB

I hope you enjoyed this part 5 of my tutorial series, and hope to see you again for part 6: Creating New nodes/Records

 

 

Posted in Treeview
9 comments on “Treeview in MS Access Part 5 – Right Click popup menu
  1. Ray Smith says:

    Hello Anders. I just received the link to your recently posted Treeview presentation under the “Access Europe” banner. Very useful indeed, and it follows on from the earlier videos you’ve posted on this subject before. I’m sure I’m not alone in thinking that Treeviews and ListViews are potentially immensely powerful tools that, in the right hands, can allow the presentation of multi-layers of information in a user friendly and flexible manner, and it seems odd to me that Microsoft haven’t made more ‘official’ documentation and tutorials available before – but I reckon you’re doing an excellent job of plugging that gap, so keep up the good work.

    The only downside I can see is that I reckon I now have some major re-writes coming up! I’ve built a number of apps in Access / SQL Server over the past year or so – including a reconciliation tool, and also my main code library – but up until now I’ve primarily used the tab control, coupled with various layers of sub-forms to perform the navigation. While that all works OK and does the job I intended, let’s face it, TreeViews are just ‘sexier’! So I can see some re-vamped front-ends coming up… 🙂

    I have a couple suggestions for future topics, in case you are in need of some inspiration:

    1 – ListView control – these are often used in conjunction with the TreeView control, so showing how to manipulate them, and maybe combine them with a TreeView would be a logical extension, and

    2 – the Ribbon – creating custom ones (with user defined tabs, buttons and actions, such as launching a form), as well as manipulating existing ribbons (for example disabling certain commands for particular users etc). I’ve tended to avoid digging into this minefield until now because it too seems to have a similar problem to the TreeView in terms of a lack of quality ‘official’ documentation from Microsoft. I think a simple, straight-forward, walk-through, along the same lines as your TreeView one would be very welcome by myself and many others.

    Once again, thanks for the time and effort you’ve put into your TreeView work, both to explain it and – more importantly – to make it understandable – it’s much appreciated.

    Ps: If there are future webcasts / meetings for Access Europe, how do I get details?

    Cheers
    Ray Smith

    • TheSmileyCoder says:

      Hi Ray
      Thank you very much for your feedback. If you signup at http://www.AccessEurope.org/Europe you should receive a notification before each meeting.

      That sounds like some excellent topics, and its even something I know a bit about. Maybe my next session (December 3rd) will be on the Ribbon.

      Best regards
      Anders

      • David says:

        I am very late to the party for this compared to when it was posted. I have been working with Access for years and I am very strong/creative with Macros and Queries. I recently started a business that we wanted to build our own ERP system more or less. I was stuck on a lot this until i saw your posts. I cannot tell you how much of a lifesaver you are and how great these videos are.

        Really, thank you so much for doing this!

        • TheSmileyCoder says:

          Its never too late to appreciate the effort that went into someone’s work. Thanks for taking the time to post.

  2. sanong says:

    Hi,

    It seems that download here is not same as in youtube.
    pls update for us.

    • TheSmileyCoder says:

      Hi Sanong
      I’m not entirely sure what you mean as there are no downloads available in youtube. If you could explain it more clearly I can investigate further.

  3. Goran says:

    Hi.

    First of all, thanks for the great work of making tutorials on treeview control. Everything I know about treeview control I’ve more or less learned watching your YouTube chanel and reading your blog.

    I have a problem with right click pop-up menus on treeview controls. Everything works fine when treeview is on a form that is not a popup form. But as soon as I change form style to Popup, the function referenced by command bar button’s OnAction property stops to function and nothing happens during runtime. The function being refernced is my custom funtion defined in form’s module. Interestingly, when I change the OnAction property with call to MsgBox it works.

    Any ideas?

    I’m working with 32-bit Access 2010 on 64-bit Windows 7.

    Kind regards,
    Goran

    • TheSmileyCoder says:

      Its been a while since I worked with this. I believe its basically that the popup doesn’t have visibility of the function in the popup form. I don’t really have anything handy that I could test this with, but what I would probably do myself would be:
      A) Make sure the forms function is declared as public
      B) If that doesn’t help, look into whether the function can be placed in a public module
      C) If that isn’t feasible, try to see if you can call the function with a syntax like Forms!FrmName!Functionname (I don’t remember the exact syntax, but recall it to be a bit difficult to work with.

      Hope that helps.

      • Goran says:

        Hi, Anders.

        Option B) putting function into the public module solved the problem.
        Thanks a lot!

        Kind regards,
        Goran

Leave a Reply

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

*