This may require some VB work but I was hoping for a simple macro solution. However, any ideas are welcome.
I have 15 identical databases in 15 cites (structure is the same, obviously the data is different).
I need to import the data from each one of these databases into one master database.
I have the queries built and a working macro but I'm having a little problem with the 'TransferDatabase' macro. I'll try to explain.
Without using a macro, I can link to an external database, select all of the tables, and click OK. Since the table names are the same between each database, Access links to all of the tables and simply appends a '1' to the end of each table name. The process takes less than 5 seconds. I don't have to name each linked table - Access does it for me. This is perfect. However, I have to do this 15 times and I'd like a macro to do the import / link for me.
In the 'TransferDatabase' I have the option to do the very same thing HOWEVER, the macro requires that I identify the table name AND specify WHAT the newly linked table name will be. This put a major crimp in my plan because I would have to specify each table and a new table name 34 (there are 34 table) times AND repeat that for each database (15 X 34 = more than I will consider doing).
So my question is: How can I create a macro that will take all of the tables from one database and link it to the master and use the default name of 'tablename1' for each linked table. Access defaults to this name when you run it manually, I just want to repeat this same process in a macro.
Any and all macro and VBA solutions are welcome.
Thanks.
I have 15 identical databases in 15 cites (structure is the same, obviously the data is different).
I need to import the data from each one of these databases into one master database.
I have the queries built and a working macro but I'm having a little problem with the 'TransferDatabase' macro. I'll try to explain.
Without using a macro, I can link to an external database, select all of the tables, and click OK. Since the table names are the same between each database, Access links to all of the tables and simply appends a '1' to the end of each table name. The process takes less than 5 seconds. I don't have to name each linked table - Access does it for me. This is perfect. However, I have to do this 15 times and I'd like a macro to do the import / link for me.
In the 'TransferDatabase' I have the option to do the very same thing HOWEVER, the macro requires that I identify the table name AND specify WHAT the newly linked table name will be. This put a major crimp in my plan because I would have to specify each table and a new table name 34 (there are 34 table) times AND repeat that for each database (15 X 34 = more than I will consider doing).
So my question is: How can I create a macro that will take all of the tables from one database and link it to the master and use the default name of 'tablename1' for each linked table. Access defaults to this name when you run it manually, I just want to repeat this same process in a macro.
Any and all macro and VBA solutions are welcome.
Thanks.