The following steps show you how to turn a blank new table (like Table1) into the Dolls table using the Datasheet view:
-
To define your table, you need to add your first record.
In this case, that means mentally picking a bobblehead doll to add to the list. For this example, you’ll use a nifty Homer Simpson replica.
Note: It doesn’t matter which doll you enter first. Access tables are unsorted, which means they have no underlying order. However, you can sort them any way you want when you need to retrieve information later on. -
In the datasheet’s Add New Field column, type the first piece of information for the record (see Figure 1-6).
Based on the simple analysis you performed earlier (Section 1.2.3), you know that you need to enter four fields of information for every doll. For the Homer Simpson doll, this information is: “Homer Simpson” (the name), “Fictional Industries” (the manufacturer), $7.99 (the price), and today’s date (the purchase date). Although you could start with any field, it makes sense to begin with the name, which is clearly an identifying detail.

Figure 1-6. To fill in your first record, start by entering something in the first field of information (like the doll name “Homer Simpson”). Then, hit Tab to jump to the second column, and then enter the second piece of information. Ignore the ID column for nowAccess adds that to every table to identify your rows.
-
Press Tab to move to the next field, and return to step 2.
Repeat steps 2 and 3 until you’ve added every field you need, being careful to put each separate piece of information into a different column.
If you want to get a little fancier, include the currency symbol ($) when you enter the price, and make sure you put the data in a recognized date format (like January 1, 2008 or 01-01-2008). These clues tell Access what type of information you’re putting in the column. (In Chapter 2, you’ll learn how to take complete control of the type of data in each column and avoid possible misunderstandings.) Figure 1-7 shows the finalized record.

Figure 1-7. The only problem with the example so far is that as you enter a new record, Access creates spectacularly useless field names. You’ll see its choices at the top of each column (they’ll have names like Field1, Field2, Field3, and so on). The problem with using these meaningless names is that they might lead you to enter a piece of information in the wrong place. You could all too easily put the purchase price in the date column. To prevent these slip-ups, you need to set better field names.
Note: If you hit Tab without entering any information, you’ll move to the next row and start inserting a new record. If you make a mistake, you can backtrack using the arrow keys. -
It’s time to fix your column names. Double-click the first column title (like Field1).
The field name switches into Edit mode.
-
Type in a new name, and then press Enter. Return to step 4.
Repeat this process until you’ve cleaned up all the field names. The proper field names for this example are Character, Manufacturer, PurchasePrice, and Date-Acquired. Figure 1-8 shows how it works.
Tip: Don’t be too timid about tweaking your table. You can always rename fields later, or even add entirely new fields. (It’s also possible to delete existing fields, but that has the drawback of also clearing out all the data that’s stored in that field.) -
Choose Office button
Save (or use the Ctrl+S shortcut) to save your table.Access asks you to supply a table name (see Figure 1-9).

Figure 1-9. A good table name’s a short text title that doesn’t have any spaces (like Dolls here).
-
Type a suitable table name, and then click OK.
Congratulations! The table’s now a part of your database.
Note: Technically, you don’t need to save your table right away. Access prompts you to save it when you close the datasheet (by clicking the X at the document window’s top-right corner), or when you close Access.
As you can see, creating a simple table in Access is almost as easy as laying out information in Excel or Word. If you’re itching to try again, you can create another table in your database by choosing Create
Table from the ribbon. But before you get to that stage, it makes sense to take a closer look at how you edit your table.
Popularity: 3% [?]
Pages: 1 2









Recent Comments