Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

List of Access 2010 Shortcut Menu 'Magic' numbers

Posted on 2013-11-17
3
Medium Priority
?
4,212 Views
Last Modified: 2013-11-17
I [previously posted a question asking how to create 'shortcut menus' in Access 2010 since the menu builder in Access 2003 was no longer available.  I got an excellent answer that works but it leads me to another question.  In the example the Cut, Copy and Paste options are added using the 'magic number' (21=Cut, 19=Copy, 22=Paste) technique.

There are many other built in Access functions that I would like to include in my menu's.  For example my shortcut menu on a report would have 'Print', 'Export' and possibly 'Email as an Attachment' options.  What are the magic numbers for these functions?

More generally where can I find a list of the magic numbers for Access functions?

Here is the code in the example I was given:
Public Function CreateCMenu()
On Error Resume Next

    CommandBars("MyContext").Delete

    Dim cmb As CommandBar 'Object
    Dim cmbBtn1 As CommandBarButton 'Object
    Dim cmbBtn2 As CommandBarButton 'Object

    Set cmb = CommandBars.Add("MyContext", _
               msoBarPopup, False, False)    ' msoBarPopup = 5
        With cmb
              ' add cut, copy, and paste buttons with the "magic number" technique that assigns
              ' appearance and behavior. The magic number goes in as the second parameter

            .Controls.Add msoControlButton, _
                  21, , , True  ' 21=Cut, msoControlButton=1
            .Controls.Add msoControlButton, _
                      19, , , True  '19= Copy
            .Controls.Add msoControlButton, _
                      22, , , True  ' 22=Paste

' add customized buttons with our caption and function name -- second param is blank
            Set cmbBtn1 = .Controls.Add(msoControlButton, _
                                    , , , True)
            With cmbBtn1
                .BeginGroup = True
                .Caption = "Create New"
                .OnAction = "=CreateNewOrder()"
                .FaceID = 59  'smiley face
            End With
           
            Set cmbBtn2 = .Controls.Add(msoControlButton, _
                                    , , , True)
            With cmbBtn2
                .Caption = "Reset"
                .OnAction = "=ClearOrder()"
            End With
        End With

   
End Function

Open in new window

0
Comment
Question by:mlcktmguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
MacroShadow earned 1000 total points
ID: 39654695
Download the file at http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6627 once extracted, you will find what you're looking in an Excel file named AccessControls
0
 
LVL 1

Author Comment

by:mlcktmguy
ID: 39654979
Thank you.  I found all that I was looking for except 'Export..."  In Access 2003 this menu option would pop up a new menu listing all the export formats to choose from.

I found specific exports "Export Excel', 'Export Word' etc.. but nothing similar to the old option.  Maybe it doesn't exist in the new version of Access.  If by chance you know what the numeric equivalent is, please let me know.

In case anyone else is interested, these are the ones I found in the list and put into a right click menu that users will see when a report is previewed.

            .Controls.Add msoControlButton, _
                      15948, , , True  ' 15948  - Print... with Dialog menu
            .Controls.Add msoControlButton, _
                      2521, , , True  ' 2521  - File Print Quick
                     
             .Controls.Add msoControlButton, _
                      12951, , , True  ' 12951 - Publish to PDF or EDoc
                 
     
            .Controls.Add msoControlButton, _
                      11723, , , True  ' 11723  Export To Excel
            .Controls.Add msoControlButton, _
                      11725, , , True  ' 11725 - Export to Word                      
            .Controls.Add msoControlButton, _
                      2188, , , True  ' 2188 File Send as attachment
0
 
LVL 1

Author Closing Comment

by:mlcktmguy
ID: 39654980
Excellent
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question