Skip to main content

Building a Database in Access

So you’ve read a few posts here at the beginning of the blog, maybe you’ve leafed ahead where I’ve referred to other chapters, and now you feel ready. You want to dive in and start building a database. Keeping in mind my previous advice to take it slowly, you can take a whack at it here.

In the following procedure, you set up a new database and then use the Table Wizard to build the first table in the database. Ready? Here we go . . .

1. If Access is not already running, take a moment to start it.

Chapter 1 shows you how to do this.

In the Access workspace, a series of large template icons appears, below a Search for Online Templates box, accompanied by links to likely searches for templates that store Assets, Business, Contacts, Employee, and so on.

2. Click the Blank Desktop Database icon.

A Blank Desktop Database dialog box appears, as shown in Figure 3-1.

Figure 3-1: New blank databases need names. Give yours one here.
Figure 3-1: New blank databases need names. Give yours one here.

3. Type a name to replace the generic DatabaseX (where X is the number assigned chronologically to the database).

You don’t need to type a file extension (.accdb); Windows 7 and 8 display your extensions automatically. Also, if you accidentally delete the file extension while changing the filename, don’t worry — Access adds it to the filename you type.

Just beneath the File Name text box, you can find the contents of the currently selected folder into which your database will be saved when you click Create.

4. If you don’t like the folder that Access picked out for you, click the little folder icon and choose where to store the new database.

As shown in Figure 3-2, when you click that little folder icon, the File New Database dialog box opens. From here, you can navigate to anywhere on your local system or on a network to which you’re connected and select the drive and folder on which to store your new database. When you’ve finished selecting a spot for your new database, click OK to return to the workspace.

Figure 3-2: Select a home for your new database.
Figure 3-2: Select a home for your new database.

5. Click the Create button.

A blank table, called Table1, appears in the central section of the workspace, and on the left, a panel lists the parts of your database (there’s just one part so far). Figure 3-3 shows your new table and the left-hand panel.

When you click Create, if a dialog box pops up and asks whether you want to replace an existing file, Access is saying that a database with the name you entered is already on the disk.
  • If this is news to you, click No and then come up with a different name for your new database.
  • If you intended to replace that old database with a new one, click Yes and proceed.

Figure 3-3: New table, new database.
Figure 3-3: New table, new database.

6. Create and name your fields in the table by double-clicking where it says Click to Add at the top of the second column in the table.

7. Click the arrow to the right of the words Click to Add and choose the type of field you want to add.

The many choices are discussed earlier in this chapter. For most fields, Text will be the type, but your data and its nature (and your desired uses for it) will dictate what’s best to choose here.

What’s that ID field in the first column? It’s there by default and will contain a unique number for each record you create (when you start entering records, later). This provides the unique field that each table requires, especially if you’re going to relate your tables. You can change its name by double-clicking the name “ID” and changing it to, for example, Customer Number.

Later on, after you’ve set up your tables and established relationships between them, you can reassign what’s known as the primary key (another name for a unique field in a table), and at that point, if you want, the ID field can be removed.

8. Type a new field name (to replace the highlighted placeholder name), and press Enter to save the new field name.

As soon as you press Enter, a new field appears, with a blank at the top, awaiting a name.

Repeat Steps 7 and Step 8 until you have all the fields you think you’ll need in this table. You can always rename them later (by double-clicking the current names), so don’t worry about perfection at this point. Just start setting up fields so you can start entering data. Figure 3-4 shows a new field name in place and a new one awaiting the Enter key to confirm it.

Figure 3-4: Create new fields by pressing Enter after naming each one.
Figure 3-4: Create new fields by pressing Enter after naming each one.

9. To save your new table and the entire database, press Ctrl+S or click the Save button on the Quick Access toolbar.

It’s a good idea to save each time you’ve done something important — building a table, updating some fields, adding records, and so on — essentially after anything you’d hate to have to do over again.

Tip:

Rarely is “Table1” a really useful name for a table. Before or after saving your database, renaming a table is easy. Just follow these steps:
  1. Right-click the Table tab.
  2. Choose Save from the pop-up menu that appears.
  3. Type a name for the table in the resulting Save As dialog box.
  4. Click OK to keep the name.
  5. Resave your database to include this change.

Comments

  1. Good job, thanks for this access 2013 guide.

    ReplyDelete

Post a Comment

Popular posts from this blog

Access Field Types and Uses

A field, you remember, is where your data lives. Each field holds one piece of data, such as Last Name or Batting Average. Because there are so many different kinds of information in the world, Access offers a variety of field types for storing it. In fact, Access puts the following field types at your disposal: Short Text Long Text Number Currency Date & Time Yes/No Lookup & Relationship Rich Text Attachment Hyperlink OLE Object Calculated There’s also an Autonumber field type, which is applied automatically to the first field in a new, blank database. The types just listed are those available for fields you create in addition to that first field — the ones that will contain your data. For now, suffice it to say that the Autonumber field is a field that contains an automatically-generated number so that each record is unique in that it has a unique autonumber, or ID. You get the word about the need for (and ways to create) unique fields later on, in Chapter

Choosing Between Flat and Relational Databases

Unlike ice cream, databases come in just two flavors: flat-file and relational. Also unlike ice cream, it’s not really a matter of preference as to which one you choose. Some databases require a relational approach; others would be overwhelmed by it. Read on to figure out how to tell the difference. Isolationist tables In a flat system (also known as a flat-file system), all the data is lumped into a single table. A phone directory is a good example of a flat-file database: Names, addresses, and phone numbers (the data) are crammed into a single place (the database). Some duplication occurs — if one person has three phone lines at home, his or her name and address are listed three times in the directory — but that’s not a big problem. Overall, the database works just fine. Tables that mix and mingle The relational system (or relational database) uses as little storage space as possible by cutting down on the duplicated (also known as redundant) data in the database. To a