Importing multiple tables/queries from 2 diff access dbs using macro or vb code

  • Thread starter Thread starter Mar via AccessMonster.com
  • Start date Start date
M

Mar via AccessMonster.com

HELP!!! I have a database that has about 30 queries and about 15 tables
that I need to import into another database using a macro or code. I don't
want the user to have to click on file, get external data, import and then
select all of them. I want to put the code behind a button for the user to
click on and the code to run and import the queries/tables that I specify.
I have been going CRAZY trying to figure this out. If anyone knows how to
do this PLEASE, PLEASE, PLEASE shed some light for me!!
 
Not really that hard. You can use either VBA or a Macro that the command
button references. The method you need is the TransferDatabase. Look it up
in Access Help. You just need a line of code for each table or query you
want to export to the other database. (When posting questions, using the
correct terms makes things clear. You really want to export them to another
database, I think. Import means copy the object from another database into
the current database. Export means copy the object from the current database
into another database.)

Good Luck
 
Klatuu - Thank you for the post. The terms I used are what I wanted to do.
I want to import the tables and queries into the current database. It's
very time consuming to setup 45 lines in the macro. I wasn't sure if there
was another faster way to import them besides using the TransferDatabase
method in a macro. - It's my first time posting and I will try to be more
precise in the future. - Thx.
 
Back
Top