Now that you know how to create a form, let's learn how to use it to enter and modify data. First, open the Plants form by clicking the Forms shortcut on the Object bar and double-clicking Plants in the Database window. You'll see that some of the user interface for a form resembles the user interface you've already seen for tables and queries, but there are new things here as well. The form shown in Figure 8.13 can tell you a lot, such as
Figure 8.13. A basic form can give you a lot of information about your data.
Navigating Fields and Records
In a table or query, you might refer to a particular column of data as a field . Forms use controls to display data. Right now the form displays the records you entered directly into the Plants table in earlier chapters.
When you open a form, Access selects the first control in the form. For instance, when you open the Plants form, Access selects the CommonName controlyou can tell because the actual entry is highlighted. To move from one control to the next , you simply press the key. Sometimes the Enter key performs the same function, but not always, so the preferred method is the Tab key. For example, press the Tab key once to select the LatinName control. Then, press Enter to select the Notes control. While in the Notes memo field, pressing Enter simply moves the insertion point to the next line in the memo field. To move to the next control, the Picture control, you must press the Tab key. Table 8.1 lists helpful keystroke combinations for navigating a form, and Table 8.2 contains combinations for navigating in a form with a subform.
Table 8.1. Keyboard Shortcuts for Navigating Controls
Table 8.2. Keyboard Shortcuts for Navigating Between a Main Form and a Subform
Did you notice that the Notes control displayed a scrollbar when you selected it? That's because that control is based on a memo data type (at the table level). We chose that data type because it can store a lot more text than the normal text data type.
When you're ready to see the next record, simply click the Next Record button on the navigation bar. Or, keep pressing the Tab key until the last control is selected, which in this case is the CatalogName control. Then, press Tab one more time. When you do, Access displays the next recordCalendula.
Entering data is simple: Just select a field and type the data. When you're done, you press Tab or Enter, as the case may be. Because the Calendula record is current, select the Notes control and enter the following text: This plant loves cooler weather and full sun but will tolerate a hot spot if you keep well watered. You can expect lots of blooms well into fall . When you're done, press Tab to select the Picture control.
Figure 8.14. Browse to the graphic file that you want to display with the current record.
Right now, none of your records are displaying pictures, but you can fix that by following these steps:
You might be curious about how a picture looks in datasheet view, so open the Plants table after you enter a few (or all) of the picture files. Figure 8.17 shows the Plants table after inserting a picture for each record. Each picture entry is a bitmap image. A table doesn't actually display a picture the same way a form or report does.
Figure 8.17. Graphic files appear as text in datasheet view.
Of course, you won't always be adding data. Sometimes you'll delete data or replace an entry with something new. Fortunately, it's all very easy in a form. When you select a control, the form automatically highlights the entry. At this point, you can do any of the following:
When you're editing records, the record selector you saw earlier changes to the small pencil icon, just as it does on a datasheet (refer to Figure 8.15). You can demonstrate this by selecting the LatinName control and pressing the Delete key. If you try this yourself, press Esc to cancel the delete task so that you don't lose data.
Adding and Deleting Records
In the previous section, you learned how to enter and delete new data. Occasionally, you'll need to add or delete an entire record. You can add records in four ways:
All the previous methods display a blank record. Notice that the record number control in the navigational control displays the number 8 you will be entering the eighth record. As soon as you begin to enter data, Access updates the record selector to display the editing symbol (the pencil icon).
Let's walk through the process of creating a new record. Do the following:
Deleting a record is even easier. After selecting the appropriate record in your form, use one of the following methods to delete that record:
After you attempt to delete the record, Access displays a confirmation message. You'd click Yes to delete the record, or you'd click No to cancel the delete task. Right now, click No because you don't want to delete the record.