fbpx
Logo
Mail us
ben@accessdatabasetutorial.com
accessdatabasetutorial
Home » Forms » Using the MS Access Macro to Automate Your Database

Using the MS Access Macro to Automate Your Database

Using the MS Access Macro to Automate Your Database


The MS Access macro has divided developers ever since their introduction. They’ve not changed a great deal in each release, although Office 2010 will see the most significant changes yet. Cryptic error messages, hard to debug and low on error checking are just some of the complaints from seasoned developers.

Despite the criticisms, MS Access macros are surprisingly powerful and you will find you can create some amazing functionality. Think about all those mundane, repetitive tasks that you end up performing time and time again. Could you automate any of them with a macro?

One of the most famous macros to use is the one named ‘Autoexec’. This macro is used for running functions when the database is opening. You could for instance automatically open up a particular screen or even output data to another source such as a spreadsheet. To create this type of macro you would simple add your actions in the designer and save the macro with the name Autoexec’. This name is known by the system and it will run it as soon as the database is launching.

For total robustness it is recommended you use VBA program code. There are many publications which can adequately teach programming and it is worth becoming competent in this useful skill. The computer industry is always looking for good programmers and if you know a Microsoft package then you will always be in demand. There may be a few specialised jobs which ask for macro experience also. Macros are not confined to MS Access. Other products in the MS Office suite of programs also use them. Excel and Word are two examples.

Let’s recap what we’ve learned in this article:

  • An MS Access macro will automate your database features
  • Opening forms and reports automatically are examples of macros
  • MS Access macro development is a good skill to have

To learn more about an MS Access macro, check out http://access-databases.com/ebooks/macros/

Article Source: http://ezinearticles.com/expert/Paul_Roger_Barnett/279463

Traditional Access developers (from days gone by) started with Access Macros and utilised ‘AutoExec’ macros as their controlled start up procedures. It’s true that the more modern approach is to either call a from using the ‘StartUp’ option (Access Options) which then triggers an event (Open or Load) from the form using another macro/VBA code or to use VBA which still uses the ‘AutoExec’ macro but calls the VBA procedure immediately.

The other Macro reserved keyword which is handy too is known as ‘AutoKeys’ which initialises at start up and assigns your customised keyboard shortcuts replacing the standard default of Microsoft Access. Therefore, CTRL + P can be replaced with your own print command (calling a custom built print form of your very own).

Most developers will lean towards VBA though but I still think Macros have a place and important role in Access especially now Access 2010 has a richer set of commands available.

Tags: , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *