What is Macro? Macros in Microsoft Access – Access Help

Ask us a question on-line
or get our email address on scr.im

Access Programmers has a mission to help people improve productivity through the effective use of technology.

 

 

Microsoft Certified Partner

  

Macros

What is a Macro?

A macro is a stored series of commands that carry out an action. They can be very useful for automating simple tasks, such as performing an action when the user clicks a command button. It is not necessary to know how to program to use macros. Macros can perform a number of the common tasks that you can also use Visual Basic code to perform and can dramatically increase your productivity when working with your database. However, using Visual Basic code rather than macros gives you much more flexibility and power. Visual Basic provides much more functionality than macros such as returning values or iterating through record sets.

Developing Macros

If you do not have a programming background, you can use the macro feature to automate simple tasks through a series of drop down selections that Access has provided. Macros allow you to easily chain commands together such as running queries, importing or exporting data, opening and closing forms, previewing and printing reports, etc. Macros support basic ‘IF condition’ logic and the ability to call other macros. Macros can also contain sub-macros which are similar to subroutines. In Access 2007, macros are significantly enhanced with the inclusion of error handling and temporary variable support. Access 2007 also introduces embedded macros that are essentially properties of an object's event. This eliminates the need to store macros as individual objects. Macros however, are limited in their functionality by a lack of programming loops and advanced coding logic. Most professional Access developers use the VBA programming language for a richer and more powerful development environment.

Designing a Macro >