Add an access key to a menu, command, or button

ShowAssign an access key to a menu or command

You can use an access key (access key: A key combination, such as ALT+F, that moves the focus to a menu, command, or control, without using the mouse.) instead of the mouse to move the focus (focus: The ability to receive user input through mouse or keyboard actions or the SetFocus method. Focus can be set by the user or by the application. The object that has focus is usually indicated by a highlighted caption or title bar.) to a menu or command. For example, press the access keys ALT+T to move the focus to the Tools menu, then press the access key O to select the Options command.

  1. On the View menu, point to Toolbars, and then click Customize.
  2. If the toolbar, menu bar, or shortcut menu isn't already shown within the program window, click the Toolbars tab, and then double-click the toolbar, menu bar, or shortcut menu name you want to show.
  3. With the Customize dialog box open, right-click the menu or command in the program window you want to specify an access key for.
  4. In the Name box, type an ampersand (&) before the character you want to use as the access key.

On the menu or command, Microsoft Access adds an underscore to the character you've designated as the access key.

 Note   Use a different access key for each command on a given menu.

ShowCreate shortcut key text for a built-in toolbar button or menu command

This procedure only creates the shortcut key (shortcut key: A function key or key combination, such as F5 or CTRL+A, that you use to carry out a menu command. In contrast, an access key is a key combination, such as ALT+F, that moves the focus to a menu, command, or control.) text. It doesn't assign the action you want the key to perform.

  1. On the View menu, point to Toolbars, and then click Customize.
  2. If the toolbar isn't already shown within the program window, click the Toolbars tab, and then double-click the toolbar name you want to show.
  3. With the Customize dialog box open, right-click the built-in toolbar (built-in toolbar: In Access 2003 and earlier, a toolbar that is part of the user interface whenit is installed on your computer. In contrast, a custom toolbar is one that you create for your own database application.) button or menu command in the program window you want to specify shortcut text for.
  4. Click Properties on the shortcut menu.
  5. In the Shortcut Text property box, type the shortcut key or key combination that you want to display. (The Shortcut Text property isn't available for custom buttons or commands.)
  6. To assign the action you want the shortcut keys to perform, create an AutoKeys macro.

ShowHow?

You can assign an action (action: The basic building block of a macro; a self-contained instruction that can be combined with other actions to automate tasks. This is sometimes called a command in other macro languages.) or set of actions to a specific key or key combination by creating an AutoKeys macro group (macro group: A collection of related macros that are stored together under a single macro name. The collection is often referred to simply as a macro.). When you press the key or key combination, Microsoft Access carries out the action. If you assign an action to a key combination that is already being used by Access (for example, CTRL+C is the key combination for Copy), the action you assign this key combination replaces the Access key assignment.

  1. In the Database window (Database window: In Access 2003 and earlier, the window that appears when a database or project is opened. It displays shortcuts for creating new database objects and opening existing objects. In later versions, it is replaced by the Navigation Pane.), click Macros Button image under Objects.
  2. Click New.
  3. Click Macro Names Button image on the toolbar.
  4. In the Macro Name column, type the key or key combination to which you want to assign the action or set of actions

Syntax for AutoKeys key combinations

The following table shows the key combinations you can use to make key assignments in an AutoKeys macro group (macro group: A collection of related macros that are stored together under a single macro name. The collection is often referred to simply as a macro.). These key combinations are a subset of the syntax used in the SendKeys statement in Microsoft Visual Basic (Microsoft Visual Basic: A high-level, visual-programming version of Basic. Visual Basic was developed by Microsoft for building Windows-based applications.).

SendKeys syntax Key combination
^A or ^4 CTRL+Any letter or number key
{F1} Any function key
^{F1} CTRL+Any function key
+{F1} SHIFT+Any function key
{INSERT} INS
^{INSERT} CTRL+INS
+{INSERT} SHIFT+INS
{DELETE} or {DEL} DEL
^{DELETE} or ^{DEL} CTRL+DEL
+{DELETE} or +{DEL} SHIFT+DEL
  1. Add the action or set of actions you want the key or key combination to carry out. For example, you could add a RunMacro action that runs the Print Current Record macro when CTRL+P is pressed.

Select a macro action to run for a key combination you define.

  1. Repeat steps 4 and 5 for any other key assignments you want to make.
  2. Save the macro group with the name AutoKeys.

The new key assignments are in effect as soon as you save the macro group and each time you open the database.

 Note   For a command on a menu, the shortcut key text appears to the right of the command. For a toolbar button, the shortcut key text appears in the ToolTip (ToolTips: Brief descriptions of the names of commands and buttons on the Ribbon. A ToolTip is displayed when the mouse pointer rests on these commands and buttons.), and only if you have selected the Show shortcut keys In ScreenTips box on the Options tab within the Customize dialog box. This dialog box is accessed through the View menu, by pointing to Toolbars and then clicking on Customize.

 
 
Applies to:
Access 2003