View Full Version : Link from Excel to Access


abc0707
07-05-2001, 08:07 AM
Here is the problem:
I have a table from Excel and I want to import to Access, how can I do it ? and what is the script to creat a button to automatically do it ?
and I want to update the table each month, therefore the access-table should have new data from Excel for each month, and it still has the old data

Thanks

pcs
07-05-2001, 08:12 AM
first things first...what do you want to do with the old data at the end of the month?
do you want to discard it or archive it?


al

abc0707
07-05-2001, 08:24 AM
I still want to keep in that table, just continue add data in that table

pcs
07-05-2001, 09:09 AM
ok.

start by looking in help for : Import Spreadsheet Wizard
i suggest you use a copy of your table for testing purposes!
this will give you an idea of how it works.

when you are comfortable that it is populating your table correctly:
look in help for: TransferSpreadsheet Method

you can call this from a command button with:

DoCmd.TransferSpreadsheet [transfertype][, spreadsheettype], tablename, filename[, hasfieldnames][, range]

be sure to look at the example to get the syntax right. also, be aware that it will be your responsibility to be sure that your users don't import the same data more than once. so make sure your table design will not permit this.

hth,
al