Home

The Records of a Table

 

Regular Data Entry

 

Introduction

To perform data entry on a table, you can click a cell under a column header and (or select) a value. Although a table appears with many rows of cells, when a table is empty with no record, only the cells just under the column header are accessible. Those cells appear with a light-blue color. If you click one of those cells, its background becomes white and its borders are orange, indicating that it is ready:

Data Entry

Another way to indicate an empty record, the field of the most left column is marked with (New) and its row of records uses the same light-blue color. After typing data into a cell, you can press Enter or Tab to move the caret to the next cell. In many circumstances you will also be able to move to the next cell by pressing the right arrow key. Sometimes you can move to the next record even if the current record is not completed. In this case, you could press the down arrow key.

When a record has been completed, the background color of its cells changes. The next record under it has the first cell marked as (New) and its empty cells are in light-blue. The other cells remain white:

The white cells cannot receive data: if you click them (with the left mouse button), nothing happens. You can only right-click them to get a context-sensitive menu.

There are three kinds of fields or cells the user will face: a field in which the user can type data, a field that displays a list as a combo box the user has to select from, and a field that does not receive input from the user. If you as the user have to select from a list, click the field that holds the list and select from the combo box. There are two kinds of combo boxes, those that accept new entries from the user and those that allow only a selection from a preset list. The classic field allows the user to just type the appropriate data in a field.

After setting the data in a particular field, you can click another cell and type the desired data. The easiest way is to press the right arrow key to move to the next field or the left arrow to move to the previous field; pressing Enter would work as well. After typing data, if you press Enter at the end of a record, the caret would move to the beginning of the next record. At anytime, you can press the up arrow key to move to the same category field of the previous record. If you press the down arrow key, the same category of the next record would receive focus.

Record Maintenance in Datasheet View

 

Record Selection

Record maintenance consists of copying, pasting, or deleting records, etc. Some of the operations you will perform on one or more records on a table require that the record(s) be selected first.

To select a row or record in Datasheet View, click the desired row header.

Record Selection

Record Selection

To select more than one record, click and hold your mouse on one of them, then drag to cover the other desired row or rows. When all desired rows are highlighted, release the mouse:

Record Selection

Another technique used to select more than one row consists of clicking one row that will be at one end, pressing and holding Shift, and then clicking the row that will be at the other end.

To select all records of a table, you can press Ctrl + A or you can click the button at the intersection of the column headers and the row headers:


 

Record Deletion

If a record is not needed anymore or has become irrelevant in a table, you can delete it. To do this:

  • You can click a row header and press Delete
  • You can right-click a row header and click Delete Record

In both cases, a message box would come up to warn you. If you find out you were making a mistake, you can click No. If you still want to delete the record, click Yes.

You can use this same approach to delete more than one record.

Practical Learning: Deleting Records

  1. The Cabins table should still be opened.
    To delete a record, right-click the box to the left of the fourth record
     
  2. Click Delete Record
  3. A warning message box will appear. Read it and click Yes
  4. To delete more than one record, click and hold the mouse on the box to the left of record number 5, then drag up to include record number 2 in the selection
     
  5. On your keyboard, press Delete
  6. Read the warning message box and press Enter
     
  7. Close the table

Copying/Pasting Records

If you have a list of records from one table and you want to use those records in another table, you can copy the records from one table and paste them in another table. You have various options.

You can copy the values of a column from one table and paste the values in another column. Both columns should be of the same type. That is, you should not attempt to paste the names of people in a column of a Boolean type (a Yes/No column that display check boxes). You can also copy and paste many columns. When selecting the columns, they should be selected in a range. After selecting and copying, you can paste the values in a range of columns of another table. The columns from the originating table and the range of columns from the target table must be of the same type. That is, the first column in each range must be of the same type; the second column of both ranges must be of the same type, and so on.

You can also copy a whole record or a range of columns. First select the range of records. Then, either right-click the selection and click Copy, or press Ctrl + C. You can then paste the records in another table.

Finding and Replacing Data

 

Editing Data

Editing a value consists of changing it. This can be done on the table or the form (or on a query as we will learn in Lesson 20). To do this, first locate the value in the field. If you are working on a table, you can click the value and use the keys (left, right, Home, End, Backspace, or the Space Bar) to edit the value. If you are working on a form, you can click the label next to a field. This would completely select the corresponding value in the control. You can then press F2 to position the caret in the control and edit its value. Alternatively, you can click the control's field and edit the value.

Finding Data

Sometimes there will be some regular problems in your database. For example during data entry, some information could be missing, mistyped, or entered in the wrong field. These problems would be easy to locate on a small table or form. If the database grows, values could become difficult to locate. Fortunately, Microsoft Access provides many tools you can use to find values and take actions.

To assist you with finding a value in a table or a form, the Home tab of the Ribbon is equipped with a section named Find:

Find

To start looking for a value, you can click the Find button Find or you can press Ctrl + F. This would open the Find and Replace dialog box with the Find tab selected:

The Find and Replace dialog box is modeless, meaning you can access the table or form in the background while the dialog box is present.

To specify the value to look for, type it in the Find What combo box. If you had previously used the dialog box, the Find What combo box keeps track of the previous searches and stores them in the control. This would allow you to perform a search on a value previously used.

The Look In combo box allows you to select the column where the value should be located. By default, when the Find and Replace dialog box displays, it selects the column or field that had focus and puts its name in the Look In combo box. You can look into that column but, if you want to search the whole table, select its name in the Look In combo box.

The Match combo box allows you to specify how close the match should be. The options are Any Part of Field, Whole Field (the default), and Start of Field.

The Search combo box allows you to specify the direction to follow. The options are Up, Down, and All (the default).

After specifying the options, you can click Find Next. After using the Find and Replace dialog box, to dismiss it, you can click Cancel or press Esc.

Replacing Data

We have seen that you can use the Find and Replace dialog box to simply locate a value. Instead of just finding it, you may want to replace the found value with an alternate. To assist you with this, you can use the Replace section of the dialog box. To get it, in the Find section of the Ribbon, you can click the Replace button Replace or you can press Ctrl + H. This would open the Find and Replace dialog box with the Replace tab selected:

Replace

You can also open the Find and Replace dialog box as we did for finding, then click the Replace tab.

The Replace section of the dialog box provides the same options at the Find counterpart with the addition of the Replace With combo box, the Replace and the Replace All buttons. After specifying what to look for in the Find What combo box, the Replace With combo box allows you to specify the value to replace the Find What with.

 

Home Copyright © 2008 FunctionX, Inc.