Ask Your Question

macro code for Base push button standard actions

asked 2017-08-10 11:17:34 +0200

baseplodder gravatar image

With Base in edit mode, clicking on a push button and then on "control" allows an "action" to be defined for that button. The drop-down button give a list of standard actions like "Save Record" "New Record" "ResetForm" "Delete Form" etc..

I am trying to write the macros that lie behind some of these "standard" actions because I want the push buttons on my form not only to perform one of these actions but then to do some more stuff (like enabling other buttons and altering the appearance of the form). Can anyone give me some guidance as how the code would look for the four actions mentioned above and perhaps also explain the difference between "Rest Form" and "Refresh Form"?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2017-08-10 18:08:18 +0200

Ratslinger gravatar image

The actions you list are single event actions. This allows a user to select an action without having to write any code. In your case you are looking to perform the action and more. To do this you will need to actually write the code for the action wanted along with the other actions you want to accomplish. You would execute your macro by tying it to one of the events for the button on the Events tab.

As for actual code, there are many references available with examples. This encompasses more information than space can allow for here. Some links:

Open Office Macros Explained (Andrew Pitonyak) - PDF here

LO Base documentation, Chapter 9 - Macros - All documentation here

Your last question is tougher to answer. Actual definitions of many events are not found or not clearly defined. An example is Reset (found here). Never used it and even with some testing can't be sure exactly what its' purpose is. Refresh is just reloading the form with current data.

If this answers your question please click on the ✔ (upper left area of answer).

edit flag offensive delete link more


Many thanks! I had come across the OoME PDF before but found it too comprehensive and not ideal for me at this stage. However your answer got me looking at the LO Base documentation once again. In Version 5 the chapter 9 has been significantly improved compared to the one I previously knew. My answers seem to start at page 17. Thanks for the tip!

baseplodder gravatar imagebaseplodder ( 2017-08-10 19:36:45 +0200 )edit

@baseplodder Just a note. OOME is not ideal for anyone at any stage when first looked at. It is a massive collection of information and a credit to its author. However, I found that taking a once through cursory look, then one small piece at a time (especially what may be of interest to you) gradually you will grasp the ability to use it as a reference.

Ratslinger gravatar imageRatslinger ( 2017-08-10 20:11:50 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-08-10 11:17:34 +0200

Seen: 1,596 times

Last updated: Aug 10 '17