Creating a Simple Table in Access 2007

Microsoft Access Add comments

The following steps show you how to turn a blank new table (like Table1) into the Dolls table using the Datasheet view:

  1. 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.


  2. 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.

  3. 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.

    UP TO SPEED
    Putting Big Values in Narrow Columns

    A column can hold entire paragraphs of information, so you may find yourself running out of space once you start typing. This phenomenon isn’t a problem (after all, you can just scroll through your field itself while you’re editing it), but it is annoying. Most people prefer to see the entire contents of a column at once.

    Fortunately, you don’t need to suffer in silence with cramped columns. To expand a column, just position your mouse at the right edge of the column header. (To expand a column named Field1, move your mouse to the right edge of the Field1 box.) Then, drag the column to the right to resize it as big as you want.

    If you’re just a bit impatient, there’s a shortcut. Double-click the right edge of the column to resize it to fit the largest piece of information that’s in the column (provided this doesn’t stretch the column beyond the edge of the Access window). That way, you automatically get all the room you need.

    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.


  4. It’s time to fix your column names. Double-click the first column title (like Field1).

    The field name switches into Edit mode.

  5. 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.

    Figure 1-8. To choose better field names, double-click the column title. Next, type in the real field name, and then press Enter. Section 2.5.1 has more about field naming, but for now just stick to short, text-only titles that don’t include any spaces, as shown here.


    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.)


  6. 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).

  7. 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

Related Post

  • Creating a Simple Query with the Query Wizard in Access 2007
  • Creating and Opening Document Workspaces in Word 2007
  • Fast Document Zooming
  • Creating a Summary Slide with a Macro in PowerPoint 2007
  • Creating a Simple Lookup with Fixed Values in Access 2007
  • Don't Find What You're Looking For? Please Try Here...

    Google
     

    Comments are closed.

    WP Theme & Icons by N.Design Studio
    Entries RSS Comments RSS Add to Technorati Favorites Log in