Copying
Information to Other Office Programs
All the
methods
of exporting data described in
this chapter work well, but they aren't the only ways to share
information with other programs.
Sometimes the quickest and
easiest
way to get
information into or out of a database is to just copy it and paste
it where you want it. This technique works particularly well for
getting data out of an Access table and into Word or Excel.
Information that you paste into a Word document becomes a Word
table, complete with a header row containing the field captions as
column headings. Information that you paste into an Excel worksheet
appears in the normal row-and-column format.
Getting data into an Access table by using this
technique is a little more complicated. The data you are pasting
must meet all the criteria for entering it by hand (input mask,
validation rules, field
size
, and so on), and you must have the
correct
cells
selected when you use the Paste command. If Access
encounters a problem when you attempt to paste a
group
of records,
it displays an error message and pastes the problem records into a
Paste Errors table. You can then troubleshoot the problem in that
table, fix whatever is wrong, and try copying and pasting
again.
Tip
To paste an entire table from one Access
database to another,
open
both databases, copy the table from the
source database to the Clipboard, and then paste it in the
destination database. You can paste the table data and/or table
structure as a new table or append the data to an existing
table.
In this exercise, you will copy and paste
records between an Access database table, an Excel worksheet, and a
Word document.
USE
the
08_CopyOffice
database. This
practice file is located in the
Chapter04
subfolder under
SBS_Access2007
.
OPEN
the
08_CopyOffice
database, then open
the Customers table in Datasheet view.
|
1.
|
Select about six records by pointing to the
row selector of the first record you want to select (the pointer
changes to a right arrow), holding down the primary mouse button,
and dragging to the last record you want to select.
|
|
2.
|
On the
Home
tab, in the
Clipboard
group,
click the
Copy
button.
Copy
|
|
3.
|
Start
Excel
, open a blank worksheet, and then
click
cell
A1
.
|
|
4.
|
On the
Home
tab, in the
Clipboard
group,
click the
Paste
button.
Excel pastes the records into the worksheet, complete with the same
column headings. (You will have to widen the
columns
to see all the
data.)
|
|
5.
|
Press
to switch back to
Access.
|
|
6.
|
Select a block of cells in the middle of the
table by pointing to the left edge of the first cell you want to
select (the pointer changes to a thick cross) and then dragging
until you have selected all the desired cells. Then in the
Clipboard
group, click the
Copy
button.
|
|
7.
|
Press
to switch back to
Excel, click a cell below the records you inserted in Step 4, and
then click the
Paste
button.
Excel pastes in the new selection, again with column headings. The
copied
data remains on the Office Clipboard
|
|
8.
|
Start
Word
and open a blank document.
|
|
9.
|
On the
Home
tab, in the
Clipboard
group,
click the
Paste
button.
Word pastes the selection as a
nicely
formatted table with the
title
Customers
, reflecting the
name
of the table from which this data came.
|
|
10.
|
Quit Word and Excel without saving your
changes.
|
CLOSE
the
Customers table and the
08_CopyOffice
database. If you are not
continuing directly on to the
next
chapter, quit Access.
|