Board logo

subject: The MS Access macro [print this page]


An MS Access macro can automate many database tasks without you having to learn or do any programming. They are extremely powerful tools to use and can really enhance the functionality of your system. Most tasks you would use a mouse or keyboard for can be taken care of with a macro. Although MS Access macros are available in many of the MS Office applications such as Excel, it is really Access which has the best macro functionality. You can use an MS Access macro to automatically open any form or report for example. Other uses include deleting records, outputting data in MS Excel, filtering data, starting other MS Office applications, renaming objects, backing up data to another database etc. There are many more, although it would take a long time to describe them all in this article. One scenario would be if you needed to email daily accounts figures to someone. The MS Access macro could be set up so that it pulls data out of the MS Access table and transfers it into an MS Excel spreadsheet. The spreadsheet could then be emailed to someone on the other side of the world perhaps. This whole operation could be added to a Windows scheduler and kicked off at any time. There is a particular MS Access macro which starts as soon as MS Access loads. It goes by the name of Autoexec. This macro is good for running tasks immediately as soon as the database opens. You may for example want the database to open a form and move to a particular record, perhaps a new one for data entry. The best way to create an MS Access macro is to give it a name and then in the macro designer create separate macro groups. Each group has a certain number of macro actions associated with it. You are also able to create conditions in an MS Access macro, rather like an if then else statement in VBA programming. For example you could say if my value on the form is equal to a certain value then perform the macro action, otherwise perform another macro action.

The MS Access macro

By: Paul Barnett




welcome to loan (http://www.yloan.com/) Powered by Discuz! 5.5.0