• Adding a Quick Key to a Macro (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Adding a Quick Key to a Macro (Access 2000)

    Author
    Topic
    #390497

    I have a macro I am quite happy with, but I failed to add a shortcut key when I wrote it. Is there a way to add a Quick Key after you have completed the macro? crossfingers

    Viewing 0 reply threads
    Author
    Replies
    • #693788

      Access is different in this respect than Word and Excel, you can’t assign a shortcut key to a macro the way you can there, through the Customize… dialog. But there are several alternatives:

      If you want to assign a shortcut key to execute a macro throughout the database, create a dedicated macro named AutoKeys. Make sure you view Macro Names when editing this macro. Macro names in the AutoKeys macro are keystrokes designated as in the VBA instruction SendKeys, for example:

      Notation Meaning
      {F9} Function key F9
      +{F3} Shift+F3
      %{Enter} Alt+Enter
      ^{Tab} Ctrl+Tab

      If you want to assign a shortcut to a macro for just one form, handle it in the KeyDown or KeyStroke event of that form, and set the Key Preview property of the form to Yes.

      • #693817

        Hmm — . I have to confess I’m not sure I understand this. You write a Macro called Autokeys that defines a key (combination of keys) that runs the macro you want a short cut for. Is that close to what you said? How would that make things faster? The Macro I want to run more quickly is an Append macro that adds a newly created table to the master table then deletes the appended table.

        • #693822

          The AutoKeys macro is opened automatically when you open the database; all shortcut key assignments stored in AutoKeys will be available as long as the database is open. You don’t have to run AutoKeys. So if you wish to assign a shortcut key to your Append macro, set the Macro Name column in AutoKeys to the code for the shortcut key, set the Action to RunMacro, and select the name of your append macro in the lower part of the macro window. When you save the macro as AutoKeys, the shortcut key will be available.

    Viewing 0 reply threads
    Reply To: Adding a Quick Key to a Macro (Access 2000)

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

    Your information: