The software developers who created Access realize that often people create substantially the same contents for their database. Access provides a couple of ways to automate database building: one way is by using database templates (which were covered in a sidebar in an earlier
module). The other way is to use the Table Wizard. Rather than building an entire database for you (as a template does), the Table Wizard enables you to quickly create a table with all the fields properly defined. Of course, once Access has made the table, you can use all the skills you will learn in this module to edit it so that it meets your individual requirements. The Table Wizard will notcreate every table that you need, but it does have options for many of the more common tables that people create in both business and personal databases.
Ready to try creating a table with the Table Wizard? This Simulation leads you through the process.
Create New Table with Wizard
Open the Table Wizard by double-clicking the "Create Table By Using Wizard" option in the database window. (Notice that in the Objects bar, Tables is selected. Tables has to be selected in order to see the Create Table By Using Wizard icon.)
The first window of the table wizard has a number of options, we will go through them one by one. The first option is two radio buttons that enable you to choose between Business and Personal tables. The tables that the wizard can create are displayed in the Sample Tables list box. This box contains different options depending on whether Business or Personal is selected. The business tables are displayed in the figure. Notice that the Sample Tables list box has a scroll bar, you cannot see all the tables unless you use the scroll bar. The first step in using the wizard is to select the table. You're going to create a table for Employees by clicking the Employees option in the Sample Tables box.
Once you select the table, the Sample Fields list changes to show you fields that are relevant to the table you selected. The next step is to select the fields you want in your table from the Sample Fields list box. You can choose all fields by clicking the double right pointing arrow, or select one at a time by selecting the field in the Sample Fields box and then clicking the single right arrow. However, the easiest way to select a single field in the Sample Fields box is to double-click it. Double-click the field Employee ID to select it for the new table.
The selected field is copied to the Fields in my new table list. We're going to select the rest of the fields for you. Click this Simulation's forward button above to advance to the next screen.
You now have six fields for your new table. You can remove or rename fields using this window. Remove the Department field from the Fields in my new table list by selecting it (we've selected it for you here) and clicking the left arrow.
You now have only five fields selected for your new table. The double left arrow removes all fields, and the rename field button allows you to rename a field. Now that all the fields you need for your table are chosen, click the Next button to see the next window of the wizard.
This window provides a name for the table--if you wanted the table to have a different name, you could type a new name in here. This window also asks you if the wizard should create a primary key. A primary key is a field that uniquely identifies each record in the table. In this case, the Table Wizard will make the EmployeeID field the primary key: each employee has a unique EmployeeID number. You will learn more about primary keys later in this course. Notice that Yes, Set A Primary Key For Me is selected and click the Next button to see the next window of the wizard.
This is the last window of the wizard. You have three choices of how to view the table: Modify the table design: This option displays the table in Design view.
Enter data directly into the table: This option displays the table in Datasheet view. Enter data into the table using a form the wizard creates for me: This option creates the table, but doesn't immediately display it. Instead, Access creates a form based on the table and
displays that. The second choice is the default choice, and fine for our purposes. Click Finish to see the table.
Here is the table the wizard created. Notice the field names across the top you'll learn how to change the width of columns so that you can see the names. This table is ready for you to enter data. This is the end of the Simulation. To close this window and return to your
lesson, click on the Exit button.
Resizing a Column
Resizing a column in MS Access 2021 can be done in two ways: a) manually dragging the border or b) using the Layout tab options. Here's how:
Manual resizing:
Open your Access database and navigate to the table view.
Position the mouse pointer over the right border of the column header you want to resize.
The pointer will change to a double-headed arrow.
Click and hold the mouse button, then drag the border to the left or right to adjust the column width.
Release the mouse button when you reach the desired width.
Using the Layout tab:
Open your Access database and navigate to the table view.
Select the column(s) you want to resize.
Click the "Layout" tab on the Access ribbon.
In the "Cell Size" group, you have several options:
Click the up and down arrows in the "Column Width" box to increase or decrease the width in small increments.
Enter a specific width value (in inches) in the "Column Width" box and press Enter.
Click "AutoFit Contents" to automatically adjust the width to fit the widest entry in the column.
Click "AutoFit Window" to adjust the width of all columns so they fit within the current window size.
Additional notes:
You can resize multiple columns at once by selecting them before using either method.
Be careful not to resize columns too narrow, as this may make the data difficult to read.
You can also adjust the row height using similar methods, by dragging the bottom border of the row header or using options in the Layout tab.
The data in this table fits neatly into the column width supplied by Access. This is not always the case. The easiest way to change column width is to double-click the right side of the column header. Here, Im changing the width of the Start Date column.
You can also click and drag to change the width of the column, place the pointer as shown in the image, then click and drag.
Creating New Table with Wizard - Exercise
Click the Exercise link below to create a table using the table wizard.
Creating New Table with Wizard - Exercise
In the next lesson you will be introduced to the datasheet.