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
Solved

List of Access 2010 Shortcut Menu 'Magic' numbers

Posted on 2013-11-17
3
3,688 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
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
MacroShadow earned 250 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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 …

856 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