• listbox menu options (Access 2002)

    Author
    Topic
    #421533

    Hi All!

    It’s so frustrating when you know you know how to do something (and know you’ve done it but can’t even remember when/where!!!) but your brain is getting old and braincells are hardening….Can someone please refresh my memory on this? Perhaps point out an example?

    I’d like to have a listbox list my reports. When the user right clicks on a report in the listbox, a popup menu appears that shows options of printing the report, previewing the report, or viewing the related data table.

    Grrr, I know I’ve done this before!!! (Afterthought: maybe it was in VB, which is why I can’t figure out how to do it in Acces???) TIA,

    Viewing 0 reply threads
    Author
    Replies
    • #958089

      You can adapt the code from How to fill a list box or a combo box with database object names to fill a list box with the names of all reports in the database.

      You can create a custom popup menu using Tools | Customize… (create a custom toolbar, then set its type to Popup) or in VBA, and set the ShortcutMenuBar property of the list box to the name of your custom context menu.

      • #958090

        Hi Hans!

        The first part I’ve got done 🙂 At least that much I remembered.

        The second part is what I’m having trouble setting up. You wouldn’t happen to have links to examples for that?

        Thanks!

        • #958121

          Can’t find any detailed ones (Microsoft Office Assistance: Create a toolbar is very short). If you explain in some detail what you want to accomplish and where you have problems, I’m sure someone here can help.

          • #958196

            Thanks, Hans. Drank an extra cup of coffee and woke my brain up. Made a custom menu, set it to popup, moved my subs to a module and made them functions and good to go. Sometimes I just need someone to shake my brain.

    Viewing 0 reply threads
    Reply To: listbox menu options (Access 2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: