Microsoft Office Tutorials and References
In Depth Information
Importing Data from an Excel Worksheet
Figure 2-22
Invoice table with four records added
Yes” value s
“No” values
To fi nish entering records in the Invoice table, you’ll use a method that allows you to
import the data.
Importing Data from an Excel Worksheet
Often, the data you want to add to an Access table exists in another fi le, such as a Word
document or an Excel workbook. You can bring the data from other fi les into Access in
different ways. For example, you can copy and paste the data from an open fi le, or you
can import the data, which is a process that allows you to copy the data from a source
without having to open the source fi le.
Oren had been using Excel to track invoice data for Belmont Landscapes and already
created a worksheet, named “Invoices,” containing this data. You’ll import this Excel
worksheet into your Invoice table to complete the entry of data in the table. To use the
import method, the columns in the Excel worksheet must match the names and data
types of the fi elds in the Access table.
Caption Property Values and the Import Process
When you want to import data from an Excel worksheet into an Access table, any
Caption property values set for the fields in the table are not considered in the import
process. For example, your Access table could have fields such as InvoiceDate and
InvoiceAmt with Caption property values of Invoice Date and Invoice Amt, respectively.
If the Excel worksheet you are importing has column headings such as Invoice Date
and Invoice Amt, you might think that the data matches and you can proceed with the
import. However, if the underlying field names in the Access table do not match the
Excel worksheet column headings exactly, the import process will fail. It’s a good idea to
double-check to make sure that the actual Access field names—and not just the column
headings displayed in a table datasheet (as specified by the Caption property)—match
the Excel worksheet column headings. If there are differences, you can change the
column headings in the Excel worksheet to match the Access table field names before you
import the data, ensuring that the process will work correctly.
The Invoices worksheet contains the following columns: InvoiceNum, ContractNum,
InvoiceDate, InvoiceItem, InvoiceAmt, and InvoicePaid. These column headings match
the fi eld names in the Invoice table exactly, so you can import the data. Before you
import data into a table, you need to close the table.
Search JabSto ::

Custom Search