Access07 Data
Access07 Data
MS Access 2007
Users Guide
ACCESS 2007
Importing and Exporting Data Files
(818) 677-1700
[email protected]
TABLE OF CONTENTS
Introduction ............................................................................................................................ 1
Import Excel to Access Considerations .................................................................................. 1
Preparing Excel Data for Import ............................................................................................. 2
Import Process ....................................................................................................................... 3
Check Imported Data for Accuracy ...................................................................................................... 8
Exporting Data to Excel .......................................................................................................... 9
Exporting Data to Excel the First Time ................................................................................................. 9
Preparing Access Data for Export .......................................................................................... 9
Run the Export Process ........................................................................................................12
Saving the Export Specification .............................................................................................13
Run a Saved task ..................................................................................................................15
Troubleshoot Missing and Incorrect Values in the Worksheet ...............................................16
Class Exercises.....................................................................................................................17
Part I - Using the Import Wizard ......................................................................................................... 17
Part II - Using the Export Wizard ........................................................................................................ 23
How to Learn More................................................................................................................26
Microsoft on the Web ........................................................................................................................ 26
Access Online Tutorials ...................................................................................................................... 26
Printed Material .................................................................................................................................. 26
Training and Support .............................................................................................................27
IT Training .......................................................................................................................................... 27
Troubleshooting and Support ............................................................................................................. 27
i
INTRODUCTION
Have you ever needed to move data from Excel to Access or from Access to Excel? Access has
features to assist with these tasks. This documentation will guide you through the following:
The import and export processes are easy to use. The wizards guide you through each process
step by step. You have the option to run the import or export one time, or the option to run it on
a regular basis.
When you import data, Access stores the data in a new or existing table without changing the
data in Excel; when you export data, Access creates a copy of the object then stores the copy in
an Excel worksheet. After you’ve run the processes several times, you’ll find it’s pretty
straightforward, especially if you’ve prepared the source data beforehand.
There are some possible conditions you need to ask yourself before deciding to import Excel to
Access. For example, suppose you use Excel to store information about all computers in your
college. Over time, the worksheet has grown too big to easily manage; you have to scroll
through too many columns and rows to find data which in turn makes it harder to find answers.
Importing data into Access will make it easier to extract those answers through the use of
queries - components that retrieve and process data quickly.
A fast and accurate way to move data from Excel to Access is by importing data from
worksheets into a new table.
Before starting the import process, the data in Excel must be cleaned up. Review the
worksheet and check for items that need to be fixed. Figure 1 shows some common errors.
Look for and fix problems in your Excel data before you start the import process using the
Import Wizard. There are limitations. They are:
1. In Access, on the External Data tab, in the Import group, select the Excel command
button (see Figure 1). The Get External Data – Excel Spreadsheet window opens.
2. In the File name box, provide the location (path) and name of your Excel workbook (see
Figure 2, #1). Select Browse to help locate your file. By moving the cursor to the right,
you will see the name of the file.
Figure 2 - Get External Data – Excel Spreadsheet Window - Select the Source and Destination
4. Select the worksheet to import (see Figure 3). This screen only shows if your
worksheet has multiple sheets. You can also select a range.
5. Select Next.
6. Always use column headings. Make sure every column has a heading. Check the box
for First Row Contains Column Headings (see Figure 4).
7. Select Next.
8. You can modify each field in the Field Options box (see Figure 5).
Figure 5 – Import Spreadsheet Wizard Window, Modify Fields in Field Options Box
• If you want to change column names, select the column and enter a new name in
the Field Name box.
• If a column is searched frequently and contains a lot of data, select the column.
For the Indexed option, select Yes. Indexing a column makes it easier and
faster to find data.
• You can set a data type for each field, though Access will do that for you. Data
types control what you can enter into a field. For example, you can’t enter text in
a field set to contain numbers; that helps keep your data accurate.
• To remove a column, select the Do not import field (Skip) check box.
9. Select Next.
10. Select Let Access add primary key (default option) (see Figure 6). Primary keys
uniquely identify each record in your table. They allow you to retrieve data more quickly
and help ensure accuracy in your data.
Figure 6 – Import Spreadsheet Wizard Window, Select Let Access Add Primary Key
You can start using it or save your import steps for reuse.
After you’ve imported your table, open the new table and review the data. Check for errors. For
example, are dates in the correct format and are all the records there? If you followed the
guidelines for preparing your data, the import should be error free.
In Access, if you want to transfer a file over to Excel, use the Export Wizard. You can export
your Access database into an Excel workbook. When the data is exported, Access creates a
copy of the data or object then stores the copy in an Excel worksheet.
If you plan to copy data from Access to Excel frequently, you can save the details for future use;
even schedule an export operation to run automatically at set times.
For example, you are a user of Access but your contact in another department is not and
prefers to work in Excel. On a regular basis, you copy data into Excel but you want to automate
this process to save yourself time.
• Must be in Access.
• Can only export one object at a time (i.e. a table, query, or form)
• Cannot export macros or modules to Excel
• If an object contains subobjects, only the main object can be exported at a time. If
you need to export the other subobjects, repeat the export process for each
subobject.
• Once all subobjects are in Excel, you can merge the data in multiple worksheets.
The following table describes the outcome of the two types of data, formatted or unformatted
(see Figure 1, below).
Access prompts you to specify the name of the destination workbook. The following
table summarizes when a workbook is created (new) and when it is overwritten
(currently exists) (see Figure 2).
Already exists A table or query The data but not the The workbook is not
formatting overwritten; a new
worksheet is added. It is
given the name of the
object from which the
data is being exported. If
the name already exists,
Access prompts you to
replace the contents or
specify another name.
Already exists A table, query, form, The data with the The workbook is
or report formatting overwritten by the
exported data. All
existing worksheets are
removed. A new
worksheet with the same
name as the exported
object is created. Data in
the Excel worksheet
inherits the format
settings of the source
object.
Data is always added in a new worksheet. You can’t append data to any existing worksheet.
5. In the Export – Excel Spreadsheet dialog box, review the suggested file name for
the workbook (Access uses the name of the source object). If you like, you can
change the file name (see Figure 2, #1).
6. In the File Format box, select the file format (see Figure 2, #2).
7. If you’re exporting a table or query, and you chose formatted data, select Export
data with formatting and layout (see Figure 2, #3).
At this point, you have completed the export operation successfully. If you want to save the
export steps you just did, do the following steps, otherwise, leave the check box blank and
select Close.
1. Select the check box next to Save export steps (see Figure 1, #1). It will save you
time. Saving the details will repeat the same export process without having to step
through the wizard each time.
2. In the Save as box, type in a name for the export (see Figure 1, #2).
Notice the Run Export button in the ribbon on the right that the task provides (see
Figure 2, #1).
7. In Outlook, review and edit the task settings like Due date and Reminder (see
Figure 2, #2). Select Recurrence to make the task recur (Figure 2, #3). If you need
information about scheduling tasks, see the article Schedule an import or export
operation from Access help.
8. Select Save & Close.
If you chose to copy the data and not the formatting, the workbook might contain multiple
worksheets. Find the sheet that corresponds to the export and review the cells.
The following table lists common errors and ways to troubleshoot them.
TIP: If you find just a few values are missing, fix them in the Excel workbook, otherwise, fix
the source object in the Access database then repeat the export process.
Part I provides practice on using the import wizard. Open the file that was copied to your
desktop in the beginning of class, Excel Sample Data.
1. Launch Access. Select the Start button on the Taskbar at the bottom left corner of your
screen.
2. Point to All Programs.
3. Select Microsoft Office from the submenu.
4. Select Microsoft Office Access 2007.
5. Under New Blank Database, select Blank Database (see Figure 3).
The wizard closes and the Get External Data – Excel Spreadsheet window appears
again.
23. Select Close (see Figure 10) and verify your imported data for accuracy.
Access imports the data to a new table named Computers. This table will appear in the
Navigation Pane of the Import Exercise Database (see Figure 11).
1. Open the Access file Access Export Example Database from the desktop.
2. Select Options.
3. Select Enable this content.
4. Select OK.
5. Double click on tblDemo in the Navigation Pane. The table is shown in Figure 13.
6. On the External Data tab, in the Export group, select Excel. The Export – Excel
Spreadsheet window opens.
Figure 14 – Export – Excel Spreadsheet Window, Select the Destination for the Data
8. Leave File Format as is. It should show Excel Workbook. See Figure 14.
9. Select Export data with formatting and layout.
10. Select Open the destination file after the export operation is complete.
11. Select OK.
Note: The following four steps are optional if you want to save the Export Specification,
otherwise, you are done.
4. Select Save Export. Since we checked the option to open the destination file upon
completion of the export, the Excel workbook is opened. Select the Excel file from the
status bar at the bottom of the screen and verify the workbook. Compare it with the
table in Access (see Figure 13). Are all the records there? Are all column headings and
data correct? The workbook looks like Figure 16. You are done!
Microsoft on the Web (www.microsoft.com) provides links to Web locations where you can find
out more about Microsoft Office 2007. It is a great resource for learning. You need internet
connectivity and a web browser to make use of this feature.
http://office.microsoft.com/en-us/access/HA100646161033.aspx
http://office.microsoft.com/en-us/help/HA100241851033.aspx
http://office.microsoft.com/en-us/access/HA101175941033.aspx
http://office.microsoft.com/en-us/access/HA100908451033.aspx
http://office.microsoft.com/en-us/access/HA100484061033.aspx
http://office.microsoft.com/training/training.aspx?AssetID=RC102722321033
Use the Help function in Access to retrieve the “How to” articles titled Import Excel
spreadsheet and Export to Excel spreadsheet
Printed Material
There are many books available online to help you learn to use Microsoft Access 2007.
Under Software/Applications, select Microsoft, then select Access. You will see links to
Books Online like, Access 2007 - Plain & Simple, Access 2007 - Forms, Reports and
Queries, and many more.
IT Training
IT Training & Development offers training in many different applications at various skill levels.
See what is coming up over the next few months by checking our website at:
http://www.csun.edu/it/training
Contact Us:
IT Training & Development
Phone: (818) 677-1700 or x1700 (on campus)
Email: [email protected]
If you experience problems getting started with Office 2007, contact the Help Center at x1400 or
[email protected].