Microsoft Office Tutorials and References
In Depth Information
Running Stand-Alone Macros and Submacros
Assigning macros to keys
Your database can contain a key-assignment macro — a macro that assigns
keys on the keyboard to run macros. If you create a macro group named
AutoKeys, and it contains submacros with the names of keys (or key
combinations) on the keyboard, Access runs the appropriate submacro when you
press the key. Figure 1-4 shows the submacro code for an AutoKeys macro
with a submacro assigned to function key F3.
Figure 1-4:
An
AutoKeys
macro
assigns
submacros to
keystrokes.
To name a key-assignment macro, use ^ for the Ctrl key, + for the Shift key,
and { } around key names that are more than one letter long. Table 1-2 shows
the names of the keys you can use. You’re restricted to letters; numbers; and
the Insert, Delete, and function keys, used in conjunction with the Shift and
Ctrl keys. Here are a few examples of key-assignment macros:
^G: Means Ctrl+G
+{F2}: Means Shift+F2
{INS}: Means the Insert key
All the submacros in the AutoKeys macro must be key assignments with
names of key combinations; otherwise, Access will complain when you save
your macro.
Table 1-2
Key Names in AutoKeys
Key Name
Key
A
A letter key (ditto for the rest of the letter and number keys)
F1 function key (ditto for the rest of the function keys)
{F1}
Insert or Ins key
{INS}
{DEL}
Delete or Del key
Search JabSto ::




Custom Search