If you have to move data out of Access database, you can do it with the help of TransferSpreadsheet in Access Macro. It is not that complicated but if you are new to Microsoft Access it might get a little confusing at first. But, it is important to learn this technique, which will be useful for basic database tasks.
Macros are great because they include a bunch of commands into one Access object. When you need to complete a certain task, you start the object and give it certain commands to run the task. For example, you might type your name in Excel into each of cells in one column, or you can save your time and have macro fill up the cells for you.
But, this time, we are going to assign the data that has to be moved to macro and then it will be moved without any interaction. Macro actions that are built in MS Access let us do it easily.
To start doing it, you should create a new macro and select “TransferSpreadsheet” in the first dialog box. You will notice a couple of options available in the lower part of the window. Here is a brief summation of what you will see.
TransferType option is asking if you are importing or exporting data. In this case, we would choose exporting data because we want to transfer data to Excel.
The Spreadsheet type option gives you the opportunity to select different versions of spreadsheets. If you are using any Excel edition after the 97th, it is better to choose the latest version, in this case Microsoft Excel 8-10, which would embrace Excel 97, 2000 as well as XP.
There is also a Table Name option, but it doesn’t have to be a table. In our situation, we would be exporting a query named “qsel_Test”.
The next option is File Name. In order to transfer data, you can use already existing file, or simply type a path and name of a file that doesn’t exist yet and it will be created for you by Access. You can try it and the file will appear magically.
Another option, which is Has Field Names, is not that important but it might be useful if you plan to work with the data in Excel. This option is asking you if you want the headings to be transferred over. If you turn this option off, then no headings will appear and the data will appear right in the Row 1 of Excel sheet.
There is also Range option, where you can define a specific range of your Excel sheet, if there is one. But usually it is a rarity.
Then you can save your macro and run it by clicking on it. And if you check your C: drive you will see that there is an Excel file with the exact data you had in your query.
Anything about microsoft access database: great training info, all sorts of business products (customized for your needs), special microsoft access database blog with tips and advice about MA databases.
All this and more from a reputable UK based company which specializes in microsoft access database and is helping clients all over the world.
