Hack #3. Work Fast and Avoid Typos

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?

Know Thy Shortcuts

Table 1-1 summarizes useful keyboard shortcuts to use within your Access applications. This isn't an exhaustive list of keyboard shortcuts—not 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 entering data.

Table 1-1. Keyboard shortcuts for entering data

Action

Keyboard shortcut

Enter the current time.

Ctrl-:

Enter the current date.

Ctrl-;

Insert data from the same field in the previous record.

Ctrl-'

Insert the default value for the field.

Ctrl-Alt-spacebar

Insert a new line in a text or memo field.

Ctrl-Enter

Enter a new record.

Ctrl-+

Paste the contents of the Windows clipboard.

Ctrl-V

These shortcuts are quite handy. Have you ever forgotten the current date when you had to enter it in a field? Well, all you need to remember now is the keyboard shortcut to enter the current date. Which brings us to the next point…

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 using—you guessed it—a keyboard shortcut. However, you need to create this shortcut.

Figure 1-7 shows a form that lists the keyboard shortcuts. The form is based on a table that holds the shortcuts and their descriptions in two respective fields. An alternative is to just use label controls in which the shortcuts and descriptions have been entered.

A quick-reference form for keyboard shortcuts

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

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 AutoKeys macro set up with a few custom keyboard shortcuts. Pressing F9 opens the frmKeyboardShortcuts form shown in Figure 1-7.

Using the AutoKeys macro to set up custom keyboard shortcuts

Figure 1-8. Using the AutoKeys macro to set up custom keyboard shortcuts

Get Access Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.