Microsoft Access 2010 tutorial:What is macro?


What is macro?

I. What is macro?

Macro is a tool that is used to automate the tasks and add functionality to the forms, reports, and controls. You can use macro to perform common actions (open a form, close a form, or find a record) without writing code in VBA procedure. By using macro, you spend less time than you write the VBA code. For example, you want to open FrmProduct from FrmProroductByCategory in order to add more products to TblProduct. The FrmProduct open when you click OpenForm button. It is easy to do this task; you just create a macro for opening a form and then drag and drop a command button on the FrmProductByCategory. Lastly, you need to connect the open form macro with the OpenForm button. Macro is divided into two types: stand-alone macro and embedded macro. Stand-alone macro is a macro that separates from the objects while the embedded macro is embedded with the objects. You can see the stand-alone macros in the Navigation Pane, under the Macro. But embedded macros are not.

One macro object can contain multiple macro actions, but they do not display under the Macro in the Navigation Pane. For example, we have a stand-alone macro group call MaCloseForms. This macro is used to close a few forms. But you cannot know which forms are closed because they do not display under the Macro in the Navigation Pane. See the figure:

Access macro group

However, you can know the forms are closed when you open the macro in Design view. To open the macro in Design view, right-click the macro in the Navigation Pane and then click Design View.

Access macro group displaying actions 

 


Comments




This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.