Importing database table question.

oihjk

Registered User.
Local time
Today, 06:57
Joined
Feb 13, 2003
Messages
51
I'm wanting to set up a macro or something else automatic to import an existing database table into the database I'm working on. In the macro I'm using the Transfer Database action. I'm wanting to automatically import a table from an external database. However, I want the user to only select which database they import and the rest be done automatically. The table names are the same in each database that they will choose from. This is what the macro looks like, again I'm using the Transfer Database action. If you know how to do it with a macro great or if you know how to use code or something else that would work please let me know.

Transfer Type: Import
Database Type: Access
Database Name: *I'm wanting this to be open ended to where the user could decide which database to import, but this is a required argument.
Object Type: Table
Source: tablename *the databases to choose from all have the same table names and structure just different data, that is why the user needs to decide which database to use, but the tablenames can be automatic.
Destination: tablename
Structure Only: No

Thanks,
Eric
 
Allowing the user to select the db to choose from means using API. Look into GetSaveAsFileName / GetOpenFileName.
This will open the common dialog control to let you select the .mdb or db file. From there you store that name into a string and use that name in the :
DoCmd.TransferDatabase() method.

Jon
 
Thanks

Thanks Jon that helps a bunch.
 

Users who are viewing this thread

Back
Top Bottom