Import Spreadsheet to Query?

Maestro

Registered User.
Local time
Today, 10:54
Joined
Jun 16, 2001
Messages
21
My database uses a query based on several tables, and I've just added a feature that exports an excel spreadsheet of the query a) to back up the information, and b) so that the XLS file can be distributed to enable other users to update their copy of the database.

The problem is getting the code right for importing. So far I've got the following but it'll only import to a table which isn't much good as I've got several tables and the query contains information from all of them.

DoCmd.TransferSpreadsheet acImport, Excel97, "Test", [BackupPath] & "\backup.xls", True

Is it possible to get Excel to import directly to a query, or is there some other way around my problem that would be easier?
 
Queries do not contain data, tables contain data. You can link to the spreadsheet (no need to import it) and then use queries that select data from the linked spreadsheet and appends it to a permanent table. You'll need separate append queries for each table.
 

Users who are viewing this thread

Back
Top Bottom