Creating a Table Using Data Type Parts
Access 2010 includes another new feature, called Data Type Parts, to assist you with creating tables and fields. Application Parts, as you just learned, help you build complete tables and other database objects, but Data Type Parts help you create individual fields or groups of fields. As you design more databases, you might find yourself needing to create similar field structures in your tables. For example, you'll probably find yourself needing to have fields in at least one table that tracks address information such as street address, city, state, and ZIP code. With Access 2010, you can now add a group of fields to track address information easily using Data Type Parts. You can also save your own custom field or groups of fields to be used in other Access applications that you create.
If you've been following along to this point, you should still have your new Contact Tracking database open with just the Contacts table in the Navigation pane. (You can also follow these steps in any open database.) To build a table using one of the Data Type Parts, you first need to have a table opened in Datasheet view. Click the Create tab on the ribbon and then click the Table button in the Tables group. Access creates a new table called Table1 with one field called ID and displays it in Datasheet view. Click the More Fields button in the Add & Delete group on the Fields tab and Access displays a large list of field types grouped by category.
Under the Basic Types, Number, Date and Time, and Yes/No categories, Access displays many options for different field types and field formats you can use in your table. You can click any of the options in these categories and Access creates a new field in your table. You'll learn more about the different field types and formats later in this tutorial. Scroll down to the bottom of the list under the More Fields button, and Access displays a list of nine Data Type Parts under the Quick Start category.
The nine Data Type Parts under Quick Start, which represent some of the more common types of fields used in a database, are as follows:
- Address Use this Data Type Part when you need fields to list address information. Clicking this option creates the following five fields-Address, City, State Province, Zip Postal, and Country Region.
- Category Use this Data Type Part when you need to create a list of categories. Clicking this option creates a list box with three generic category names.
- Name Use this Data Type Part to create fields to store the names of people. Clicking this option creates the following fields-Last Name, First Name, Contact Name, and File As.
- Payment Type Use this Data Type Part when you need a list of payment types for order tracking or contribution tracking purposes. Clicking this option creates a list box called Payment Type with four options-Cash, Credit Card, Check, and In Kind.
- Phone Use this Data Type Part when you need to create fields to store phone numbers. Clicking this option creates the following fields-Business Phone, Home Phone, Mobile Phone, and Fax Number.
- Priority Use this Data Type Part when you need to create a list of priority levels. Clicking this option creates a list box with three generic priority levels-(1) High, (2) Normal, and (3) Low.
- Start and End Dates Use this Data Type Part when you need fields to track start dates and end dates. Clicking this option creates two Date/Time fields.
- Status Use this Data Type Part when you need to create a list of status levels. Clicking this option creates a list box with five generic status levels-Not Started, In Progress, Completed, Deferred, and Waiting.
- Tag Use this Data Type Part when you need to create a list that allows you to select multiple items. Clicking this option creates a multi-value list with three generic items-Tag 1, Tag 2, and Tag 3.
Click Name under the Quick Start category and Access creates four fields ready for you to use to track names of your contacts. You can add more Data Type Parts to this table by clicking another option under the Quick Start category.
To add the Address Data Type Part to this table, first click the Click To Add entry to move the focus to the right of the File As field in the table Datasheet view. Access always adds new fields to the left of where the current focus is located in the Datasheet view grid. Now click the More Fields button in the Add & Delete group on the ribbon and then click Address under the Quick Start category. Access creates five more fields in your table. Your table now has fields to track the address information for your contacts.
Using Data Type Parts can save you time when you're designing your tables in Access 2010 by giving you a jump start on creating common field types. Close the Table window now, and do not save the changes to this table when Access prompts you to save the changes.
In this tutorial:
- Designing Client Tables
- Creating a New Database
- Creating a New Empty Database
- Creating Your First Simple Table by Entering Data
- Creating a Table Using Application Parts
- Creating a Table Using Data Type Parts
- Creating a Table in Design View
- Understanding Field Data Types
- Setting Field Properties
- Nulls and Zero-Length Strings
- Defining Simple Field Validation Rules
- Defining Input Masks
- Defining a Primary Key
- Defining a Table Validation Rule
- Understanding Other Table Properties
- Defining Relationships
- Defining Your First Relationship
- Creating a Relationship on Multiple Fields
- Adding Indexes
- Multiple-Field Indexes
- Setting Table Design Options
- Creating a Default Template for New Databases
- Printing a Table Definition
- Database Limitations