Typing Data into a Database
After you create a database table and define fields within that table to hold chunks of information, you are ready to type in actual names, phone numbers, and e-mail addresses into each field. Access gives you two ways to enter data:
- Through Datasheet view
- Through Form view
Datasheet view displays information in rows and columns, where each row represents a single record and each column defines a specific field name. Datasheet view can be especially handy for examining multiple records at once. Form view displays all the fields of a single record onscreen. Form view is most useful when you just need to view or edit a single record, such as typing in the phone number of your cousin or boss.
Using Datasheet View
Datasheet view is the default view for entering data. To view and enter data in Datasheet view, follow these steps:
- Click the Office Button and then choose Open. The Open dialog box appears and then click the Access database file you want to add or edit data in, and then click Open. Access displays your chosen database.
- In the All Tables pane on the left of the screen, double-click a table. Access displays the Datasheet view of your table.
- Click in a field defined by the column and row. Each column defines a field, such as a name or address. Each row represents a single record. If you click in a field that already contains data, you can edit or delete that data.
- Press Tab to select the next field (or Shift+Tab to select the previous field).
- Type or edit the data in the field.
Using Form View
The biggest problem with Datasheet view is that it can be confusing to find a field for a specific record. Because most people are familiar with paper forms or index cards that arrange related data (fields) on a page, Access offers you Form view.
Form view simply displays the fields of a single record onscreen. To use Form view, you must first create a form and arrange your fields on that form. After you create a form, you can add, edit, and view data through that form.
Creating a Form
The simplest way to create a form is to let Access design one for you, which you can modify. To create a form quickly, follow these steps:
- Click the Office Button and then choose Open. The Open dialog box appears and then click the Access database file you want to add or edit data. Then click Open. Access displays your chosen database.
- In the All Tables pane on the left of the screen, double-click a table. Access displays the Datasheet view of your database and then click the Create tab.
- Click the Form icon in the Forms group. Access creates a form as shown in Figure. Notice that the form name automatically uses the name of the database table you chose in Step 2.
- Click the Office Button and then choose Save (or click the Save icon on the Quick Access toolbar). The Save As dialog box appears, asking you to type a name for your form.
- Type a descriptive name for your form in the Form Name text box and then click OK. Access displays your form’s name underneath the All Tables pane. The next time you open this database and want to view the form, you can double-click the form’s name in the left pane.
Viewing and Editing Data in a Form
After you create a form, you can use it to edit and add data at any time. To view a form, follow these steps:
- Click the Office Button and then choose Open. The Open dialog box appears and then click the Access database file you want to add or edit data. Then click Open. Access displays your chosen database.
- In the All Tables pane on the left of the screen, double-click the name of the form you want to use. Access displays the Form view of your database.
- Click one of the following icons to display a record:
First Record:
Displays the first record stored in your file.
Previous Record:
Displays the previous record in the file.
Next Record:
Displays the next record in the file.
Last Record:
Displays the last record that contains data.
New (Blank) Record:
Displays a blank form so you can type in data that will create a new record in your file. - Click in a field and type the information you want to store, such as a name or phone number.
You do not need to use the Save command to save your changes because Access automatically saves any data you add or edit in your file as soon as you type or edit the data and move the cursor to a new field or record.
Editing a Form
A form can be a convenient way to view all the fields of a single record. However, you can always rearrange the position of certain fields onscreen (to make them easier to find), or you can delete one or more fields altogether. This can be handy to create a form that shows only a filtered view of your data, such as a form that shows you only employee names, phone numbers, and e-mail addresses rather than also showing you their salary and employee ID number at the same time.
Deleting a Field
If you delete a field from a form, you simply prevent the form from displaying any data stored in that field. For example, if you do not want to see each person’s hire date, you can delete the Hire Date field from your form. Deleting a field on a form does not erase any data, it just keeps you from seeing that data on a particular form. To delete a field from a form, follow these steps:
- Click the Office Button and then choose Open. The Open dialog box appears and then click the Access database file you want to add or edit data. Then click Open. Access displays your chosen database.
- In the All Tables pane on the left of the screen, double-click the name of the form you want to use. Access displays the Form view of your database.
- Click the Home tab and then click the downward-pointing arrow underneath the View icon in the Views group. A pull-down menu appears.
- Choose Design View. Access shows your chosen form in Design view, which displays a background grid to help you align fields on your form and then click a field you want to delete. Access highlights your chosen field.
- Click the Delete icon in the Records group. Access deletes your chosen field. If you press Ctrl+Z right away, you can undelete any field that you just deleted.
- Click the downward-pointing arrow underneath the View icon in the Views group. A pull-down menu appears, choose Form View. Access shows your form with the deleted field missing.
Adding a Field
Before you can add a field to a form, you must make sure that the field already exists in your database table. For example, if you want to add a field on a form that displays phone numbers, you must first create that field in your database table and then stuff it with actual data. To add a new field to a database table, follow these steps:
- Click the Office Button and then choose Open. The Open dialog box appears and then click the Access database file you want to add or edit data. Then click Open. Access displays your chosen database.
- In the All Tables pane on the left of the screen, double-click the name of the database table that displays data through a form. Access displays the Datasheet view, showing rows and columns.
- Click the Add New Field column that appears to the right of your database table. Access highlights the entire column.
- Click the Datasheet tab and then click the Rename icon in the Fields and Columns group. The cursor appears in the column heading you chose in Step 3.
- Type a descriptive field name, such as E-Mail or Birthday, and then press Enter.
- Click in the column of the field you just created and named and then type new data.
After you either create a new field or verify that a field already exists in a database table, you are ready to add that field to a form. To add a field to a form, follow these steps:
- Click the Office Button and then choose Open. The Open dialog box appears and then click the Access database file you want to add or edit data. Then click Open. Access displays your chosen database.
- In the All Tables pane on the left of the screen, double-click the name of the form you want to use. Access displays the Form view of your database.
- Click the Home tab. and then click the downward-pointing arrow underneath the View icon in the Views group. A pull-down menu appears, choose Design View. Access displays your form in Design view.
- Click the Design tab.
- Click the Add Existing Fields icon in the Tools group. The Field List window appears.
- Double-click a field. Access displays the field label and a field on your form.
- (Optional) Move the mouse pointer over the upper-right corner of the field label and drag the mouse (hold down the left mouse button and move the mouse) to move the field label on your form.
- (Optional) Repeat Step 7, except move the field instead of the field label.
- Click the downward-pointing arrow underneath the View icon in the Views group. Access displays the Form view. Notice that the form displays both your newly added field and any data stored in that field.
- Click the Office Button and choose Save to save the changes to your form.
