Assign an action or set of actions to a key

Microsoft Office Access 2003

Show All Show All

Assign an action or set of actions to a key

You can assign an action or set of actions to a specific key or key combination by creating an AutoKeys macro group. 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, 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

    ShowSyntax for AutoKeys key combinations

    The following table shows the key combinations you can use to make key assignments in an AutoKeys macro group. These key combinations are a subset of the syntax used in the SendKeys statement in Microsoft Visual Basic.

    SendKeys syntax Key combination
    ^A or ^4 CTRL+A or CTRL+4
    {F1} F1
    ^{F1} CTRL+F1
    +{F1} SHIFT+F1
    {INSERT} INS
    ^{INSERT} CTRL+INS
    +{INSERT} SHIFT+INS
    {DELETE} or {DEL} DEL
    ^{DELETE} or ^{DEL} CTRL+DEL
    +{DELETE} or +{DEL} SHIFT+DEL
  5. 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.

  6. Repeat steps 4 and 5 for any other key assignments you want to make.
  7. 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.