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.

23 Create a simple macro

Please note that macro recording is limited in LibreOffice Base due to program stability issues.

24 Open Database

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.

25 Open Form

In the form window, go to Tools->Macros->Record Macro

Any actions you take from now on will be recorded in the macro.

26 Record Macro

Click the New record icon.

Next, click the ‘Stop Recording’ button.

27 Name Macro

Name the macro ‘Newrecord’ then click ‘Save’.

We will use this macro in the next tutorial so remember where you save it.

28 Run Macro

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.