Using Keyboard Operations for Entering and Editing Data

Although Access is mouse-oriented, keyboard equivalents are provided for the most common actions. One reason for providing keyboard commands is that constant shifting of the hand from a keyboard to mouse and back can reduce data-entry rates by more than half. Shifting between a keyboard and mouse also can lead to or aggravate repetitive stress injury (RSI), of which the most common type is carpal tunnel syndrome (CTS).

Keyboard operations are as important in a data-entry environment as they are in word processing applications. Consequently, the information concerning key combinations for data entry appears here rather than be relegated to fine print in an appendix. The data-entry procedures you learn in the following sections prove quite useful when you come to the Entering Personnel Actions Table Data and Testing Validation Rules section near the end of the chapter.

Creating an Experimental Copy of Northwind.mdb

If you want to experiment with the various keyboard operations described in the following sections, you are wise to work with a copy of the Northwind.mdb database. By using a copy, you don't need to worry about making changes that affect the sample database. Experimenting also gives you the opportunity to try the Access database-compacting operation described in Chapter 3, "Navigating Within Access."

Tip

If you're not short on fixed-disk space, open a new database and copy the Northwind.mdb Customers and Orders tables to your new database as described in the Copying and Pasting Tables section of Chapter 4, "Working with Access Databases and Tables."


To compact Northwind.mdb to a new copy of Northwind.mdb, follow these steps:

1.
Close all open document windows.

2.
Choose File, Close, or click the Database window's Close Window button to close the database. Access reverts to a blank window.

3.
Choose Tools, Database Utilities, Compact Database to open the Database to Compact From dialog. In this case, the file is compacted to make a copy of the Northwind.mdb file.

4.
Double-click the Northwind.mdb item in the Database to Compact From dialog's list box. The Compact Into dialog appears.

5.
You can accept the default file name, db1.mdb, in the Filename text box, or you can enter a more creative name, such as Illwind.mdb, in the Filename text box, and then click Save. Compacting a database file with a new name creates a new, compacted database that you can use for testing.

6.
Choose File, Open Database, and double-click db1.mdb or the name of your file from step 5.

7.
Open the Customers table by double-clicking its entry in the Database window.

Note

Most keyboard operations described in the following sections apply to tables and updatable queries in Datasheet view, text boxes on forms, and text boxes used for entering property values in Properties windows and in the Field Properties grid of Table Design view. In the examples, the Arrow Key Behavior property is set to Next Character rather than the default Next Field value. See the later section Setting Data-Entry Options for instructions on how to change the value of the Arrow Key Behavior property. When the Arrow Key Behavior property is set to Next Field, the arrow keys move the caret from field to field. Data-entry operators accustomed to DOS or mainframe database applications usually prefer the Next Character approach.


Using Data-Entry and Editing Keys

Arrow keys and key combinations in Access are, for the most part, identical to those used in other Windows applications. Little resemblance exists between these combinations and the key combinations used by DOS database managers, however. The F2 key, used for editing cell contents in Excel, has a different function in Access—it toggles between editing and select mode. Toggle means to alternate between two states. In the editing state, the caret indicates the insertion point in the field; the key combinations shown in Table 5.1 are active. If the field is selected (indicated by a black background with white type), the editing keys behave as indicated in Table 5.2.

Note

In the following tables, the term field is used in place of the more specific description data cell or cell to maintain consistency with Access documentation and Help windows. A field, in conventional database terminology, indicates the collection of data consisting of the contents of a certain category of information in every record of the table.

The term grid in the following tables indicates a display in tabular form that doesn't represent fields and records. The list of fields and their descriptions in table design mode is an example of a grid.


Table 5.1. Keys for Editing Fields, Grids, and Text Boxes
KeyFunction
F2Toggles between displaying the caret for editing and selecting the entire field. The field must be deselected (black text on a white background), and the caret must be visible for the keys in this table to operate as described.
Ctrl+EndMoves the caret to the end of the line.
Ctrl+EndMoves the caret to the end of a multiple-line field.
Moves the caret one character to the left until you reach the first character in the line.
Ctrl+←Moves the caret one word to the left until you reach the first word in the line.
HomeMoves the caret to the beginning of the line.
Ctrl+HomeMoves the caret to the beginning of the field in multiple-line fields.
BackspaceDeletes the entire selection or the character to the left of the caret.
DeleteDeletes the entire selection or the character to the right of the caret.
Ctrl+ZUndoes typing, a replace operation, or any other change to the record since the last time it was saved. An edited record is saved to the database when you move to a new record or close the editing window.
Alt+BackspaceSame as Ctrl+Z.
EscUndoes changes to the current field. Press Esc twice to undo changes to the current field and to the entire current record, if you edited other fields.

Table 5.2. Keys for Selecting Text in Fields, Grids, and Text Boxes
SelectionKeyFunction
Text within a fieldF2Toggles between displaying the caret for editing and selecting the entire field. The field must be selected (white type on a black background) for the keys in this table to operate as described.
 Shift+→Selects or deselects one character to the right.
 Ctrl+Shift+→Selects or deselects one word to the right. Includes trailing spaces.
 Shift+←Selects or deselects one character to the left.
 Ctrl+Shift+←Selects or deselects one word to the left.
Next fieldTab or EnterSelects the next field. The "Setting Default Data Entry Options" section later in this chapter tells you how to change the effect of the Enter key.
RecordShift+spacebarSelects or deselects the entire current record.
 Selects the preceding record when a record is selected.
 Selects the next record when a record is selected.
ColumnCtrl+spacebarToggles selection of the current column.
 Selects the column to the left (if a column is selected and a column is to the left).
Fields and recordsF8Turns on Extend mode. You see EXT in the status bar. In Extend mode, pressing F8 extends the selection to the word, field, record, and all records.
 Shift+F8Reverses the last F8.
 EscCancels Extend mode.

Operations that select the entire field or a portion of the field, as listed in Table 5.2, generally are used with Windows Clipboard operations. Selecting an entire field and then pressing Delete or typing a character is a quick way of ridding the field of its original contents.

Using Key Combinations for Windows Clipboard Operations

In Table Datasheet view, the Clipboard is used primarily for transferring Access data between applications. However, you also can use the Clipboard for repetitive data entry. Access 97 enables you to select a rectangular block of data cells in a table and copy the block to the Clipboard. To select a block of cells, follow these steps:

1.
Position the mouse pointer at the left edge of the top left cell of the block you want to select. The mouse pointer (shaped like an I-beam until this point) turns into a cross similar to the mouse pointer for Excel worksheets.

2.
Drag the mouse pointer to the right edge of the bottom right cell of the desired block.

3.
The selected block appears in reverse video (white on black). Release the mouse button when the selection meets your requirement.

A selected block of data in the Customers table appears in Figure 5.1. You can copy data blocks but cannot cut them.

Table 5.3 lists the key combinations for copying or cutting data to and pasting data from the Clipboard. When you paste data from the Clipboard, all of it is pasted to a single cell if it is of the correct data type and fits within the size of the field. You also can use the Cut, Copy, and Paste toolbar buttons to substitute for the key combinations. Another alternative is to choose Edit, Cut, Copy, or Paste.

Figure 5.1. Selecting a rectangular data block in Table Datasheet view.


Table 5.3. Key Combinations for Windows Clipboard Operations
KeyFunction
Ctrl+CCopies the selection to the Clipboard.
Ctrl+InsertCopies the selection to the Clipboard.
Ctrl+VPastes the Clipboard's contents at the caret location.
Shift+InsertPastes the Clipboard's contents at the caret location.
Ctrl+XCopies the selection to the Clipboard and then deletes it. This operation also is called a cut. You can cut only the content of a single cell you select with the caret.
Shift+DeleteCopies the selection to the Clipboard and then deletes it. This operation also is called a cut. You can cut only the content of a single cell you select with the caret.
Ctrl+ZUndoes your last Cut, Delete, or Paste operation.
Alt+BackspaceUndoes your last Cut, Delete, or Paste operation.

Tip

If you attempt to paste a rectangular block into a cell, you receive a Data too long for field error message. Access then creates a Paste Errors table that contains the contents of the rectangular block, which is a quick way to create a new table. If you create a table this way, rename it immediately, or Access overwrites the table with a new Paste Errors table the next time a paste error occurs.


Using Shortcut Keys for Fields and Text Boxes

Shortcut keys minimize the number of keystrokes required to accomplish common data-entry tasks. Most shortcut key combinations use the Ctrl key with other keys. Ctrl+C, Ctrl+V, and Ctrl+X for Clipboard operations are examples of global shortcut keys in Windows 95. Table 5.4 lists shortcut keys applicable to field and text box entries.

Table 5.4. Shortcut Keys for Text Boxes and Fields in Tables
KeyFunction
Ctrl+;(semicolon)Inserts the current date
Ctrl+:(colon)Inserts the current time
Ctrl+'(apostrophe) or Ctrl+" (quote)Inserts the value from the same field in the preceding record
Ctrl+EnterInserts a newline character (carriage return plus line feed) in a text box
Ctrl++(plus)Adds a new record to the table
Ctrl+-(minus)Deletes the current record from the table
Shift+EnterSaves all changes to the current record

Tip

Emulating the data-entry key behavior of DOS or mainframe RDBMSs can make a major difference in the acceptance of your database applications by data-entry operators who have years of experience with DOS or mainframe database applications.


Setting Data-Entry Options

To modify the behavior of the arrow keys and the Tab and Enter keys, choose Tools, Options and click the Keyboard tab to display the keyboard options settings. Table 5.5 lists the available options with the default values. (This table also appears in Chapter 3, "Navigating Within Access.") These keyboard options enable you to make the behavior of the data entry keys similar to that of DOS database managers, such as early versions of dBASE and Paradox.

◂◂ See "Keyboard Options," p. 95

Table 5.5. Keyboard Options for the Access System
OptionGroupFunction
Don't MoveMove After EnterWhen this option is selected, the caret remains in the current field when you press Enter.
Next Field (default)Move After EnterWhen this option is selected, the caret moves to the next field when you press Enter. Use this setting to duplicate xBase behavior.
Next RecordMove After EnterWhen this option is selected, the caret moves down the column to the next record when you press Enter.
Next Field (default)Arrow Key BehaviorIf this option is selected, pressing the right or left arrow keys moves the caret to the next field.
Next CharacterArrow Key BehaviorIf this option is selected, pressing the right or left arrow keys moves the caret to the previous or next character in the same field. Use this setting if you want to duplicate the behavior of xBase or mainframe databases.
Select Entire Field (default)Behavior Entering FieldWhen this option is selected, the entire field's contents are selected when you use the arrow keys to move the caret into the field.
Go to Start of FieldBehavior Entering FieldSelecting this option causes the caret to move to the beginning of the field when you use the arrow keys to move the caret into the field.
Go to End of FieldBehavior Entering FieldSelecting this option causes the caret to move to the end of the field when you use the arrow keys to move the caret into the field. Use this setting to duplicate xBase and mainframe database behavior.
Cursor Stops at First/Last FieldNoneSelecting this option keeps the caret from moving to another record when the left or right arrow keys are pressed and the caret is in the first or last field of the record.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.31.240