With your database open from the Menu - Tools > Macros > Organise Macros > LibreOffice Basic. Your database name will be at the bottom of the list on the left hand side. Click on the database name and select New from the right hand buttons. A popup will open with Title "New Module" with default name "Module1" - click OK. The Basic Editor will open with a new blank macroSub Main End Sub
 Sum Main MsgBox "You pressed Me!" End Sub