Creating Tables in MS-Access
Creating Tables in MS-Access
OBJECTIVE:
Students
are expected to be familiar with MSAccess environment. Build a table by entering field names and setting data types. Create table using the Datasheet View, Table Templates, and Design View. Update table values using a lookup field a field that contains a list of choices. Create a relationship. Can successfully create simple tables.
1.
Assign a File Name: CreatingTables_FamilyName then click create Type the desired file name
2.
3.
4.
4.
Notice how the new table contains a field called ID. That's your primary key, simply DOUBLE-CLICK the first field header and enter the primary key, then press ENTER.
5.
5.
Go to the next blank field and enter a name in that header. Repeat the process until you've entered names for all your fields but with a couple exceptions: don't add any lookup fields, and don't add foreign key fields.
7.
When you've finished, go to the Quick Access Toolbar and click Save. In the Save As dialog box, enter the name for the table and click OK.
6.
7.
Customer
After you enter field names, you'll need to set the data type for each field. 2.
3. 1.
1.
2. 3.
Select the field that needs a data type. Just click the field header. If it isn't already selected, click the Datasheet tab. In the Data Type & Formatting group, open the Data Type list and select an option.
The templates capture data for common business needs, and all the fields and data types are set up for you.
1.
2.
1. 2.
Click the Create tab. In the Tables group, click Table Templates, and then click the template you want to use. You can use the template right away just start entering data or you can add, remove, or change the fields. Just make sure you save the table and give it a descriptive name.
Design view allows you to build a table from scratch and set or change every available property for each field. You can also open existing tables in Design view and add, remove, or change fields.
1. 4.
2.
3.
1.
2.
3.
2.
In the Field Name column of the designer, enter the names of your table fields. As a rule, the first field you create should be your primary key field. And remember that you don't need to add any foreign key fields now. You can do that when you create your relationships.
3.
3.
4.
In the Data Type column, use the list next to a field name to choose a data type for that field. Optionally, use the Field Properties pane to set properties for individual fields. For example, you can use the pane to change the values in a lookup field. Dont forget to save changes and give your new table a name that describes the data it contains
2.
1. 3.
Click the Datasheet tab, and in the Fields & Columns group, click Lookup Column to start the Lookup Wizard.
On the first page of the wizard, click I want to lookup column to look up the values in a table or query. and click Next.
Fourth page of the wizard will ask you what sort order you want for the List Box. Fifth page of the wizard will allow you to adjust the columns for the look up field.
4.
7.
On the next page of the wizard, select the table that contains the field needed for your look up and click next.
5.
8.
On the last page, enter a name for the new field and click Finish.
The third page of the wizard, select the field(s) from the Available Fields: and click the arrow to the right so that the field(s) will be in the Selected Fields: and click next.
2.
5.
3.
4.
On the first page of the wizard, click I will type in the values that I want and click Next. On the next page of the wizard, make sure the Number of columns box contains a 1 and then enter your options in the grid, one option per row. On the third page of the wizard, enter a name for the new field and click Finish.
5.
4. 1.
2.
5.
1.
Switch your table to Datasheet view. You can do that by right-clicking the tab for the table and clicking Datasheet view. Click the Datasheet tab, and in the Fields & Columns group, click Lookup Column to start the Lookup Wizard.
2.
Click the Datasheet tab. In the group Relationships select the Realtionships.
2.
4.
Select the line that connects the table and right click, select Edit Relationship