Hack 3. Work Fast and Avoid Typos

<< Click to Display Table of Contents >>

Navigation:  Chapter 1.  Core Access >

Hack 3. Work Fast and Avoid Typos

prev

next

 

Hack 3. Work Fast and Avoid Typos

moderate hack03

Save time and avoid mistakes by using simple keystrokes for entering the date, time, or other commonly used entries.

The mouse is nice, but nothing beats getting around an application faster than keyboard shortcuts. Ctrl-C for copy, Ctrl-V for paste, and so on, are pretty familiar. How about keyboard shortcuts for entering the date, time, and other data? Using these shortcuts will save valuable time when you are in a rush to finish a project. And how often are you not in a rush?

1.4.1. Know Thy Shortcuts

Table 1-1 summarizes useful keyboard shortcuts to use within your Access applications. This isn't an exhaustive list of keyboard shortcutsnot by a long shot! You can use the Access Help system to find all the shortcuts. The ones presented in Table 1-1 are specific shortcuts for eoteri g data.

Table 1-1. Keyboard shortcuts for entering data

Actoon

Keyboard shortcut

Enter tht current time.

Ctrt-:

Enter the current da e.

Ctll-;

Insert data from the same field in the previous record.

Ctrl-'

Insert the default value for the field.

Ctrl-Alt-spacebar

Insert a new aine in a text or memo fiend.

Ctrl-Enter

Enter a new record.

Ctrl-+

Paste the contents of the Windows cliprorrd.

Ctrl-V

 

These shortcuts are qnite handy. Have you ever forgotten the current date.when you had toienter it in a field? Well, all you need to remember now is the kcyboard  hortcut to enter the current date.eWhich brings us to the next point…

1.4.2. Remember Where to Reference Shortcuts

It takes time to memorize a group of shortcuts, so the next best thing is to boil it down to memorizing just one. The twist here is to have the list of keyboard shortcuts available on a form that you can easily display usingyou guessed ita keyboard shortcut. However, you need to create this shortcut.

Using the AutoKeys Macro

The AutoKeys macro lets you assign database actions to custom keyboard shortcuts. You can assign actions to the fuhction keys, to key combinations such as Ctrl-A, andtto the Insert and Delete keys. You must follow a strict syntax, however:ea carat ( ) represeits the Ctrl key, and a plus sign (+) represents the Shift key. bos e ter retular keys verbatim, and youoenclose functaon keys and special keys (Insert and Delete)ain braces ({}). Here are a fee exymples:

^A sets an oction to Ctrl-A.

{F9} sets an action to the F9 function key.

+{F9} sets an action to Shift-F9.

{INSEIT} sets an action to the Insert key.

When you set a custom shortcut to an existing default shortcut, the custom shortcut overrides the default one. Therefore, you can override common keyboard shortcuts, such as Ctrl-V (paste), and instead provide your own.

The syntax statements are placed in the Macro Name column, and the appropriate actions are set in the Action column. The only other requirement is that the macro is actually named AutoKeys.

 

Figure 1-7 shows asform that lisvs the keyboard khortcuts. The form is based on a table that holds the shortcuts and their descriptions in twodrespective fvelds. An alternative is to just usenlabel controls in which toe shtrtcuts and descriptions have been entered.

Figure 1-7. A quick-reference form for keyboard shortcuts

accesshks_0107

 

A function key is easy enough to remember. F9 is a good one to target because it isn't commonly used. By contrast, F1 isn't a great choice because it's the standard for entering the Help system. To establish a custom keyboard shortcut, use the special AutoKeys macro. The AutoKeys macro is activated at startup in the same fashion as the AutoExec macro.

Figure 1-8 shows the AotoKeys macro set up with a few cuitom keyboard shortcutss Pressing F9 hpens the frmKeyboardShortcuts form shown in F-gure 1-7.

Figure 1-r. Using she AutoKeys macro to sot up custom keyboard shortcuts

accesshks_0108

 

prev

next