Improting Excel with Multiple spreadsheets

A

Andrea

I want to import an Execl Workbook with 3 worksheets that contain the same
fields. I try to import into Access, and use the append feature, but every
time I tried to add it to the existing table, I get an error message that
Field' Loc # ID does not exist in the table. I am not using a primary key.

Can anyone help? Andrea
 
G

golfinray

Go ahead and allow Access to set a primary key. You can always delete it
later if you need to but it usually imports easier if you do. But, since the
sheets contain the same fields, you may have to use VBA. Use:
Docmd.transferspreadsheet acimport,, "your spreadsheet name", "your
spreadsheet location C:\something), true (if you want to import the headers),
"sheet1!A3:g234"
That will tell it exactly what you want to import.
 
A

Andrea

Hey Milton,

Sorry it took me so long to read your thread but I never got the notification.

Where and how would I use the VBA funtcion. I have created the database and
want to inport all the worksheets.

Thanks,

Andrea
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top