I need to have a command button that will import a table into Access. the table will always be saved in My documents-C:\Mydocuments\whatever.txt
The users of this database do not know how to import a file so I have to create a button that will do this for them. Does anyone know what I need to do. Runcommand Import will only take me as far as My documents. I need a full Import command. Please help.
You can use the macro 'TransferText' property to import the file.
After that in you can call the macro when ever you want.
Or you can use "convert macro to VB", Then you will see the VB code of importing and exporting files to Access.
I tried the Transfer Text action and it seems to be the perfect answer to my problem-however, the macro asks for a specification name. It says to select from a list but when I click on the list box, I have no data to select from.
What do you think?
The specification name you have to do it by your self only in the first time.
You can do that by these steps:
1. Go to the "File" menu.
2. Choose "Get external data" ---> Import
3. Then you choose the Table or what you ever want to import.
4. Access create Specification pattern of your import. This is used like a pattern to all the data that you import in the future.
5. After you end, when you go to the macro you will see the specification name that you gave in the import wizard, appears in the specification name list.
By this way Access willn't ask you in the future to do that more.