Using Keyboard Operations for Entering and Editing Data

Access is mouse-oriented, as are most Windows applications, but keyboard equivalents are available for the most common actions. One reason for providing keyboard commands is that constantly shifting the hand from a keyboard to a mouse and back can reduce data-entry rates by more than half. Shifting between a keyboard and mouse can also 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 instead of being relegated to fine print in an appendix. The data-entry procedures you learn in the following sections prove useful when you come to the "Testing Field and Table Validation Rules" section near the end of the chapter.

Creating a Working Copy of Northwind.mdb

If you want to experiment with the keyboard operations described in the following sections, 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. An easy way to make a copy of Northwind.mdb is to save a copy with a different name in the Access 2002 file format.

Tip

graphics/power_tools.gif

This chapter uses the HRActions table for data entry and validation examples. If you didn't create the HRActions table in the preceding chapter, choose File, Get External Data, Import, and import the HRActions table from the location where you saved the CD-ROM files, typically C:\Program Files\Seua11\Chaptr05. After you import the table, choose Tools, Relationships, add the HRActions table, and create a one-to-many relationship between the EmployeeID fields of the Employees and HRActions table. Nwind05.mdb only contains tables and a single query.


To create a copy of Northwind.mdb in Access 2002 format, follow these steps:

  1. graphics/window_database.gif With the Access 2000 version of Northwind.mdb open, close all windows except the Database window.

  2. Choose Tools, Database Utilities, Convert Database, To Access 2002 Format to open the Convert Database Into dialog. Unless you've changed the Default Database Folder property in the General Page of the Options dialog, the default location for saving the copy is My Documents.

  3. You can accept the default file name (Db1.mdb) in the Filename text box, or you can type a more descriptive name, such as Nwind2002.mdb, in the Filename text box, and then click Save. Acknowledge the message that states that Access 2000 and earlier users can't open the database.

  4. graphics/open.gif Click the Open button on the toolbar to display the Open dialog, and double-click the new .mdb file to open it.

Setting Data-Entry Options

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. When the Arrow Key Behavior property is set to Next Field, the arrow keys move the cursor from field to field. Data-entry operators accustomed to mainframe terminals or DOS applications probably prefer to use the Next Character setting.

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 (see Figure 6.1). Table 6.1 lists the available options with the default values. These keyboard options let you emulate the behavior of the data-entry keys of mainframe terminals.

Figure 6.1. The settings you specify on the Keyboard page of the Options dialog apply to all databases you open, because they're stored in your computer's Registry.

graphics/06fig01.gif

Table 6.1. Keyboard Options for All Access Databases

Option

Function

Move After Enter Group

Don't Move

When this option is selected, the cursor remains in the current field when you press Enter.

Next Field (default)

When this option is selected, the cursor moves to the next field when you press Enter. Use this setting to duplicate dBASE and its clones' behavior.

Next Record

When this option is selected, the cursor moves down the column to the next record when you press Enter.

Arrow Key Behavior Group

Next Field (default)

If this option is selected, pressing the right- or left-arrow keys moves the cursor to the next field.

Next Character

If this option is selected, pressing the right- or left-arrow keys moves the cursor to the previous or next character in the same field. Use this setting if you want to duplicate the behavior of mainframe terminal or xBase applications.

Behavior Entering Field Group

Select Entire Field (default)

When this option is selected, the entire field's contents are selected when you use the arrow keys to move the cursor into the field.

Go to Start of Field

Selecting this option causes the cursor to move to the beginning of the field when you use the arrow keys to move the cursor into the field.

Go to End of Field

Selecting this option causes the cursor to move to the end of the field when you use the arrow keys to move the cursor into the field. Use this setting to duplicate mainframe terminal and xBase behavior.

Individual Settings

Cursor Stops at First/Last field

Marking this check box keeps the cursor from moving to another record when the left or right arrow keys are pressed and the cursor is in the first or last field of the record.

graphics/new.gif

Datasheet IME Control

Enables the Input Method Editor (IME) for entering data in East Asian languages (Windows XP and 2003 only).

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. The F2 key, used for editing cell contents in Excel, has a different function in Access F2 toggles between editing and select mode. (Toggle means to alternate between two states.) In the editing state, the cursor indicates the insertion point in the field; the key combinations shown in Table 6.2 are active. If the field or any character in the field is selected (indicated by a black background with white type), the editing keys behave as indicated in Table 6.3.

Table 6.2. Keys for Editing Fields, Grids, and Text Boxes

Key

Function

F2

Toggles between displaying the cursor for editing and selecting the entire field. The field must be deselected (black text on a white background) and the cursor must be visible for the keys in this table to operate as described.

End

Moves the cursor to the end of the field in a single-line field or the end of the line in a multiple-line field.

Ctrl+End

Moves the cursor to the end of a multiple-line field.

Moves the cursor one character to the left until you reach the first character in the line.

Ctrl+

Moves the cursor one word to the left until you reach the first word in the line.

Home

Moves the cursor to the beginning of the line.

Ctrl+Home

Moves the cursor to the beginning of the field in multiple-line fields.

Backspace

Deletes the entire selection or the character to the left of the cursor.

Delete

Deletes the entire selection or the character to the right of the cursor.

Ctrl+Z or Alt+Backspace

Undoes 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.

Esc

Undoes 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 6.3. Keys for Selecting Text in Fields, Grids, and Text Boxes

Key

Function

Text Within a Field

F2

Toggles between displaying the cursor 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 Field

Tab or Enter

Selects the next field if the default Next Field option is selected.

Record

Shift+spacebar

Selects or deselects the entire current record.

Selects the first field in the preceding record when a record is selected.

Selects the first field in the next record when a record is selected.

Column

 

Ctrl+spacebar

Toggles selection of the current column.

Selects the first field in the column to the left (if a column is selected and a column is to the left).

Fields and Records

F8

Turns on Extend mode. You see "EXT" in the status bar. In Extend mode, pressing F8 extends the selection to the word, then the field, then the record, and then all the records.

Shift+F8

Reverses the last F8.

Esc

Cancels Extend mode.

Operations that select the entire field or a portion of the field, as listed in Table 6.3, generally are used with Windows Clipboard operations.

Tip

Selecting an entire field and then pressing Delete or typing a character is a quick way to rid 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, such as copying data to an Excel worksheet or a Word table. However, you can also use the Clipboard for repetitive data entry. Access lets you 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. graphics/invoice.gif Position the mouse pointer at the left edge of the top-left cell of the block you want to select. The cursor (a 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 type (white on black, also called reverse video). Release the mouse button when the selection meets your requirement.

  4. Press Ctrl+C to copy the selected block to the Clipboard.

Figure 6.2 shows a selected block of data in the Customers table. You can copy data blocks but can't cut them.

Figure 6.2. You can select a rectangular block of data to copy to the Clipboard, and paste the block to cells of an Excel worksheet or Word table.

graphics/06fig02.jpg

Table 6.4 lists the key combinations for copying or cutting data to and pasting data from the Clipboard.

Table 6.4. Key Combinations for Windows Clipboard Operations

Key

Function

Ctrl+C or Ctrl+Insert

Copies the selection to the Clipboard.

Ctrl+V or Shift+Insert

Pastes the Clipboard's contents at the cursor's location.

Ctrl+X or Shift+Delete

Copies 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 cursor.

Ctrl+Z or Alt+Backspace

Undoes your last Cut, Delete, or Paste operation.

Tip

To create a new table from the copied block, click the Create Table by Entering Data option in the Database window and choose Edit, Paste Append to add the block to the table. Pasting the records to the table doesn't add the field names, so you must replace the default Field1...Fieldn names in Table Design view.


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. Table 6.5 lists shortcut keys for field and text box entries.

Tip

Ctrl+' or Ctrl+" are the most important of the shortcut keys for entering table data. The ability to copy data from a field of the preceding record into the same field of a new record is a welcome timesaver.


Table 6.5. Shortcut Keys for Text Boxes and Fields in Tables

Key

Function

Ctrl+; (semicolon)

Inserts the current date

Ctrl+: (colon)

Inserts the current time

Ctrl+' (apostrophe) or

Inserts the value from the same field in the preceding record

Ctrl+" (double quote)

 

Ctrl+Enter

Inserts a newline character (carriage return plus line feed, CRLF) in a text box

Ctrl++ (plus)

Adds a new record to the table

Ctrl+ (minus)

Deletes the current record from the table

Shift+Enter

Saves all changes to the current record

Tip

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




Special Edition Using Microsoft Office Access 2003
Special Edition Using Microsoft Office Access 2003
ISBN: 0789729520
EAN: 2147483647
Year: 2005
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net