2140004Access_C01_MS12.qxd 6/29/10 1:05 PM Page 1

CHAPTER= 1 Access

More Skills 12 Import Data from Excel

᭤ An Excel worksheet that organizes records in rows and fields in columns can be imported into Access using the Import Wizard. ᭤ You can import records to create a new table or import records into an existing table.

To complete this database, you will need the following files: ᭿ a01_Art_Classes ᭿ a01_Art_Class_Sections ᭿ a01_Art_School

You will save your database as: ᭿ Lastname_Firstname_a01_Art_School

1. Click Start , and then locate and click Excel 2010. 2. Click File, and then click Open. In the Open dialog box, navigate to the student files for this chapter. Select a01_Art_Class_Sections, and then click Open. Compare your screen with Figure 1. The header row displays the same field names as the Art Sections table, and each record displays in a single worksheet row. The Section ID column contains unique values—a requirement for any data that will be imported into a field that is a primary key.

Header row contains field names

Records in rows with unique class names

Figure 1

Work with Databases and Create Tables | Chapter 1 More Skills: SKILL 12 | Page 1 of 5

From Skills for Success with Microsoft® Office 2010 Vol. 1 Copyright © 2011 by Pearson Education Inc. publishing as Prentice Hall. All rights reserved. 2140004Access_C01_MS12.qxd 6/29/10 1:05 PM Page 2

3. Click File, and then click Exit. If a message displays asking if you want to save changes, click Don't Save. 4. Start Access. Locate and open the file a01_Art_School. Save the file in your Access Chapter 1 folder as Lastname_Firstname_a01_Art_School If the security message displays, enable the content. 5. On the External Data tab, in the Import & Link group, click the Excel button. 6. Select the Append a copy of the records to the table option button. Compare your screen with Figure 2. In the Get External Data - Excel Spreadsheet dialog box, you can create a new table, add records to an existing table, or link the spreadsheet data to an Access table. When you link data, the table data is stored in the Excel spreadsheet instead of the Access file.

Get External Data - Excel Spreadsheet dialog box

Option to create a new table

Option to add data to an existing table

Option to link to the data

Figure 2

Work with Databases and Create Tables | Microsoft Access Chapter 1 More Skills: SKILL 12 | Page 2 of 5

From Skills for Success with Microsoft® Office 2010 Vol. 1 Copyright © 2011 by Pearson Education Inc. publishing as Prentice Hall. All rights reserved. 2140004Access_C01_MS12.qxd 6/29/10 1:05 PM Page 3

7. Click the Browse button. In the File Open dialog box, navigate to the student files and select a01_Art_Class_Sections, and then click Open. 8. In the Get External Data - Excel Spreadsheet dialog box, click OK to display a sample of the Art_Class_Sections worksheet in the Import Spreadsheet Wizard, as shown in Figure 3.

Import Spreadsheet Wizard

Sample data from Excel worksheet

Figure 3

Work with Databases and Create Tables | Microsoft Access Chapter 1 More Skills: SKILL 12 | Page 3 of 5

From Skills for Success with Microsoft® Office 2010 Vol. 1 Copyright © 2011 by Pearson Education Inc. publishing as Prentice Hall. All rights reserved. 2140004Access_C01_MS12.qxd 6/29/10 1:05 PM Page 4

9. In the Import Spreadsheet Wizard, click Next, and then click Finish. In the Get External Data - Excel Spreadsheet dialog box, click Close. 10. In the Navigation Pane, double-click the Art Class Sections table. Verify that 25 records were imported. If asked by your instructor, print the data sheet. Close the table. 11. On the External Data tab, in the Import & Link group, click the Excel button. 12. Click the Browse button. In the File Open dialog box, navigate to the student files and select a01_Art_Classes, and then click Open. 13. In the Get External Data - Excel Spreadsheet dialog box, verify that the Import the source data into a new table in the current database option button is selected, and then click OK. 14. In the Import Spreadsheet Wizard, click Next. Click the First Row Contains Column Headings check box. Compare your screen with Figure 4.

Import Spreadsheet Wizard First Row Contains Column Headings check box

Column headings

Figure 4

Work with Databases and Create Tables | Microsoft Access Chapter 1 More Skills: SKILL 12 | Page 4 of 5

From Skills for Success with Microsoft® Office 2010 Vol. 1 Copyright © 2011 by Pearson Education Inc. publishing as Prentice Hall. All rights reserved. 2140004Access_C01_MS12.qxd 6/29/10 1:05 PM Page 5

15. Click Next two times. Select the Choose my own primary key option button. Compare your screen with Figure 5. When you create a new table by importing data from Excel, Access will suggest creating a new AutoNumber field as the table’s primary key. Here, each Class Title will have a unique value and can be the table’s primary key.

Class Title will be the primary key

Figure 5

16. Click Next. In the Import to Table box, replace the selected value with Art Classes and then click Finish. In the Get External Data - Excel Spreadsheet dialog box, click Close. 17. In the Navigation Pane, double-click the Art Classes table. Verify that seven records were imported. If asked by your instructor, print the datasheet. Close the table. 18. Exit Access. Submit your printouts or submit the database file as directed by your instructor. ᭿ You have completed More Skills 12

Work with Databases and Create Tables | Microsoft Access Chapter 1 More Skills: SKILL 12 | Page 5 of 5

From Skills for Success with Microsoft® Office 2010 Vol. 1 Copyright © 2011 by Pearson Education Inc. publishing as Prentice Hall. All rights reserved.