Import Excel to Access (1 Viewer)

ria_arora

Registered User.
Local time
Today, 15:42
Joined
Jan 22, 2011
Messages
56
Hello Dear Friends,

I have two access files. First file keeps only the Code and second file contains all the tables and data.

I want to import the data from excel sheet into access (Second file which contains all the tables) using VBA. Below code is written in first file and data need to be imported in second file. What is the syntax I need to use for this?

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, sTable, "c:\Options.xls", True

Thanks a lot in advance for the help.


Ria
 

CharlesWhiteman

Registered User.
Local time
Today, 08:42
Joined
Feb 26, 2007
Messages
421
Are they two unrelated database's (what version of Access?) or are you using linked front End / Back End?

If you use a split database then it could be more straightforward
 

ria_arora

Registered User.
Local time
Today, 15:42
Joined
Jan 22, 2011
Messages
56
Dear Charles,

Version of Microsoft Access is 2002. Yes both are unrelated database. One database contains Form, VBA Code only and second database contains the Tables and data. So user whatever the activities will perform that'll be done in second database which contains all the data.

Thanks
Ria
 

ria_arora

Registered User.
Local time
Today, 15:42
Joined
Jan 22, 2011
Messages
56
Dear John,

Both thread are not identical.

I want to import the data in different database not in CurrentDB.

I have two different databases (.mdb files). One file contains only VBA Code (No Table, Query) and another database contains all the tables and queries. In other words Code is written in one database and data need to be imported in another database.

Hope this clarify the problem.

Regards
Ria

 

Users who are viewing this thread

Top Bottom