converting an excel spreadsheet into an access...

18
Converting an Excel Spreadsheet Into an Access Database Tracey L. Fisher Personal Computer and Software Instructor Butler County Community College - Adult and Community Education Exceeding Your Expectations….. http://users.zoominternet.net/~traceylf/bc3.htm

Upload: others

Post on 21-Sep-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

Tracey L. Fisher Personal Computer and Software Instructor

Butler County Community College - Adult and Community Education

Exceeding Your Expectations….. http://users.zoominternet.net/~traceylf/bc3.htm

Page 2: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

TABLE OF CONTENTS

PURPOSE.............................................................................................................................................. 3

WHAT YOU WILL NEED....................................................................................................................... 3

TERMINOLOGY .................................................................................................................................... 4

GETTING STARTED ............................................................................................................................. 5

CREATING A NEW DATABASE .......................................................................................................... 7

IMPORTING A SPREADSHEET ........................................................................................................... 9

FINDING DUPLICATE RECORDS...................................................................................................... 14

EVALUATING DUPLICATE RECORDS............................................................................................. 17

Page 3: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

PURPOSE The focus of this handout is to walk you through the process of Importing an existing Excel Spreadsheet into a new Access Database. It is assumed you have both Excel and Access experience and is not intended to review the fundamentals of these applications. Many times Access databases are initially created from Excel spreadsheets as it is very easy to maintain large lists in Excel. However, as your list becomes larger and you want to manipulate your data in more complex ways, converting the spreadsheet into a database may become necessary. WHAT YOU WILL NEED

Microsoft Excel Microsoft Access Access to the Internet

Floppy Disk

Hint: This reference guide was developed using Microsoft Excel and Access 2003. The topics discussed are applicable to previous versions. However, the steps to perform specific functions may differ slightly in older versions.

© Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 3 of 18

Page 4: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

TERMINOLOGY

Database – A database is a collection of information organized into interrelated tables of data and specifications of data objects.

Field names – One column (data element) contains data of one and the same kind.

Form – A type of object you can use to enter, edit, and view records.

Import – A way of converting data from a different format and coping it into Microsoft Access.

Primary Key – The primary key of a relational table uniquely identifies each record in the table.

Properties – The characteristics of a screen element. For example, a number may have properties

such as number of decimal points, font, size, etc.

Query – A question asked of the database that determines what information is retrieved.

Record – One row or group of related data, for example the data for one individual’s contact information.

Record Selection Buttons – Navigation buttons located on the record navigation toolbar to quickly

move between records or a group of records.

Table – A collection of related information comprised of columns (fields) and rows (records). A table looks like a simple spreadsheet.

Task Pane - Task panes in Microsoft Office help you get your work done, bringing the tools you

need right up close to your work. Task panes open automatically when you perform certain tasks, such as start a new document, ask for Help, or insert clip art.

© Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 4 of 18

Page 5: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

GETTING STARTED After sending out your holiday cards last year, did you make yourself a promise that you would organize your address list to into a database by the time you have to send holiday cards next year? Or, perhaps, your address book consists of several scraps of paper you have scattered around your house. Do you have an Excel spreadsheet with thousands of entries and are finding many are duplicated or entered multiple times with only a small difference such as a state name spelled out and the abbreviation not used? You are well on your way to organizing your contact list or moving that out-of-control Excel spreadsheet into a Microsoft Access database. It's much easier than you may imagine and you'll most likely ask yourself why you put this off so long. This handout will walk you through the entire process step-by-step. No prior knowledge of databases is required, but it is helpful to get the most out of your data. If you're curious, you may be interested in attending my Level 1 Microsoft Access class. Open the sample Excel file used in this handout - http://users.zoominternet.net/~traceylf/AddressList.xls (if link does not work by clicking, copy/paste into Internet Browser window)

1. Click OK

2. From the Menu Bar select File, Save As © Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 5 of 18

Page 6: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

3. Click the drop-down arrow in the Save in box and select 3 ½ Floppy Disk (A:) 4. Next, change the name of the spreadsheet to AddressList in the File name box 5. Click the Save button

© Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 6 of 18

Page 7: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

CREATING A NEW DATABASE The first step we’ll need to do is to create a new, blank database. We’ll have the option of allowing a Wizard to step us through; however, we’re going to create ours from scratch so you can see how simple it is to create a new database. Make sure that the "Blank Access database" radio button is selected (as shown in the figure below) and click the OK button to get started. Open Microsoft Access by clicking the Start button, selecting All Programs, Microsoft Office, Microsoft Access. Note: Depending on how your software is installed, you may or may not have the Microsoft Office folder.

1. Click the Create a new file link in the Getting Started Task Pane

2. Click the Blank Database link in the New File Task Pane © Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 7 of 18

Page 8: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

3. Click the drop-down arrow in the Save in box to select the location to save your new database 4. Next, type the name of your new database in the File name box 5. Click the Create button

Congratulations, you have just created your AddressList database. Our next step is to Import the AddressList spreadsheet.

© Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 8 of 18

Page 9: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

IMPORTING A SPREADSHEET

1. From the Menu Bar select File, Get External Data, Import

2. Click the drop-down arrow in the Look in box and browse to the location of your spreadsheet. In

this example, your AddressList.xls file is saved on your floppy drive. 3. Click the drop-down arrow next to Files of type list box and select Microsoft Excel (*.xls)

© Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 9 of 18

Page 10: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

4. Select the spreadsheet you want to import into Access and click the Import button 5. The Import Spreadsheet Wizard is activated. The following will walk you through each step of the

Wizard to assist you with the Import process.

1. In this example, we are importing only Sheet1 of the AddressList spreadsheet. Click the Next

button.

© Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 10 of 18

Page 11: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

2. Click the check box First Row Contains Column Headings. The Excel Column Headings will

become the Fields in the AddressList Table. Click Next.

3. Because we are creating a new Access Database, you will need to click the option button In a New

Table. The wizard will import your spreadsheet into a new database table. Click Next to continue.

© Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 11 of 18

Page 12: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

4. You have the option of modifying the field names (column headings) for each of the fields you are

importing. In our example, we will import all column headings from our spreadsheet and will accept the default options. Click Next to continue.

5. You have the option of allowing Access to define a Primary Key for your new database table. In

our example, we are going to Let Access add primary key. Notice that a new field (column) was added to the Left of the last name column. The ID number is a unique number which will identify each record in your database table. Click Next to continue.

© Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 12 of 18

Page 13: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

6. The last step is to name your database table. In the Import to Table box type Addresses and click

Finish.

7. Click OK. Access will now import your spreadsheet into the AddressList database and create the

Addresses table

8. Access opens to the Tables object window and the Addresses table is listed in the object window.

To open the database table, double click the Addresses table. © Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 13 of 18

Page 14: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

9. Click the Record Selection buttons to move among the different records in your database. 10. Click the lower red X to close the database table or click the upper red X to close Microsoft Access

and the database table. Congratulations! You have successfully imported an Excel spreadsheet in an Access database. Before you begin working with your newly created Access database, it is recommended that you create and run a query that will assist you with deleting duplicate records in your list. FINDING DUPLICATE RECORDS Close the table and in the Access Database window, select the Query object button on the left.

1. Click the Queries object button to open the Queries window © Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 14 of 18

Page 15: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

2. Click NEW

3. From the New Query window, select Find Duplicates Query Wizard 4. Click OK

© Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 15 of 18

Page 16: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

5. Select either the Table or Query 6. Click Next

7. Select the files that may contain duplication information 8. Click Next

Hint: Select all fields in the table to confirm the entire record is a duplicate!

© Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 16 of 18

Page 17: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

9. Name the Query 10. Click Finish EVALUATING DUPLICATE RECORDS

1. The Find Duplicates for Addresses query opens. 2. Query results will show any record that has been entered multiple times 3. Review the results and make any necessary updates such as correcting typographical errors or

delete the record. 4. Changes to the duplicated records must be made from the Table 5. Run the Query again to confirm all duplicates have been removed

Hint: For a record to be a duplicate, every field must be an exact match.

© Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 17 of 18

Page 18: Converting an Excel Spreadsheet Into An Access Databaseusers.zoominternet.net/~traceylf/Converting_an_Excel... · 2004. 8. 29. · 5. You have the option of allowing Access to define

Converting an Excel Spreadsheet Into an Access Database

6. In the Query object window, select the Find Duplicates for Addresses query and click Open

7. The query results should display zero records. Now, you can use your Access skills to enhance the table properties, create a form to make the data entry of new address easy, or create queries to extract records that meet the criteria you specify.

© Copyright 2004 Tracey L. Fisher, All Rights Reserved Page 18 of 18