Home > Sample chapters > Microsoft Office > Access

Create Databases and Simple Tables

Manipulating Table Columns and Rows

In Chapter 1. we showed you how to quickly adjust the width of table columns to efficiently display their data. In addition to adjusting column width, sometimes you might want to rearrange a table’s fields to get a better view of the data. For example, if you want to look up a phone number but the names and phone numbers are several fields apart, you will have to scroll the page to get the information you need. You might want to rearrange or hide a few fields to be able to simultaneously see the ones you are interested in.

You can manipulate the columns and rows of an Access table without affecting the underlying data in any way. You can size rows and size, hide, move, and freeze columns. You can save your table formatting so that the table will look the same the next time you open it, or you can discard your changes without saving them.

In this exercise, you’ll open a table and manipulate its columns and rows.

  1. In the Navigation pane, double-click the Customers table to open it in Datasheet view.

  2. In the field name row, point to the right border of the Street field name, and when the pointer changes to a double-headed arrow, drag to the right until you can see all of the street addresses.

  3. Double-click the right border of any column that seems too wide or too narrow to adjust the column to fit its contents.

    This technique is particularly useful in a large table where you can’t easily determine the length of a field’s longest entry.

  4. Point to the border between any two record selectors, and drag downward.

    When you release the mouse button, Access increases the height of all rows in the table.

    httpatomoreillycomsourcemspimages1744863.jpg

    You cannot adjust the height of a single row.

  5. On the Home tab, in the Records group, click the More button, and then click Row Height.

    httpatomoreillycomsourcemspimages1744865.jpg

    The Row Height dialog box opens.

    httpatomoreillycomsourcemspimages1744867.jpg

    You can set the rows to the precise height you want.

  6. In the Row Height dialog box, select the Standard Height check box, and then click OK.

    Access resets the height of the rows to the default setting.

  7. Click anywhere in the FirstName field. Then in the Records group, click the More button, and click Hide Fields.

    The FirstName field disappears, and the fields to its right shift to the left.

  8. To restore the hidden field, in the Records group, click the More button, and then click Unhide Fields.

    The Unhide Columns dialog box opens.

    httpatomoreillycomsourcemspimages1744869.jpg

    You can select and clear check boxes to control which fields are visible.

  9. In the Unhide Columns dialog box, select the FirstName check box, and then click Close.

    Access redisplays the FirstName field.

  10. If you can see all of the fields in the table, for the purposes of this exercise, adjust the size of the program window until some of the fields are no longer visible.

  11. Point to the CustomerID field name, hold down the mouse button, and drag through the FirstName and LastName field names. With the three columns selected, click the More button in the Records group, and then click Freeze Fields.

  12. Scroll the page to the right until the Phone field is adjacent to the LastName field.

    The first three columns remain in view as you scroll.

  13. In the Records group, click More, and then click Unfreeze All Fields to restore the fields to their normal condition.

  14. Click the Phone field name to select that field. Then drag the field to the left, releasing the mouse button when the thick black line appears to the right of the LastName field.

  15. Close the Customers table, clicking Yes to save the changes you have made to the column widths and order. If you see a warning that this action will clear the Clipboard, click Yes.