Advanced Database – Create a simple macro
First, make sure that macro recording is enabled.
Open a Libreoffice Base database file. From the main window taskbar select Tools->Options then select LibreOffice->Advanced.
Check the optional feature: Enable macro recording.
Please note that macro recording is limited in LibreOffice Base due to program stability issues.
In the current version of Base, macros can only be recorded to modify forms.
This is due to the fact that it can often be useful to add a button to a form that runs a macro, as we will see later.
We are going to record a simple macro that adds a new record.
Open any form in the database.
In the form window, go to Tools->Macros->Record Macro
Any actions you take from now on will be recorded in the macro.
Click the New record icon.
Next, click the ‘Stop Recording’ button.
Name the macro ‘Newrecord’ then click ‘Save’.
We will use this macro in the next tutorial so remember where you save it.
To run the macro, re-open the same form.
Go to Tools->Run Macro
Select the Newrecord macro and run it.
It will automatically create a new record, without having to select the icon at the bottom of the page.