Create a button to automatically import SQL table Access 2007
Posted on 2012-04-13
I found these instructions: First, manually go through the Wizard, and before you get to the last step where you actually import the data, click on the Advanced button and save you Import Specification (give it a name).
Then create a macro to import the data (using the TransferText command). The Help will tell you what it needs in each argument.
Now, if you highlight that macro, you can go to the Tools button and select Macro | Convert Macros to Visual Basic. This will give you the code that you need to place behind your command button to automatically import your files.
My problem in trying to follow them is: The Advanced button never comes up. Also, I really need a way to replace the data in the existing table, rather than create a new one. Some of the things I have read say: If you Choose Create a new table and the table exists, it will overwrite it. I also do not get the choice of create or append.
I only get: Import the source data into a new table in the current database (I am choosing this one)
The other choice is Link to the data source by creating a linked table(Not what I want to do).
Then I choose my data source and import table, It goes straight to All objects imported sucessfully. There is a check box to Save the import steps. I checked it. Entered the save as information. Clicked Save Import.