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:
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.
This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages: