Macro code for Base push button standard actions

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”?

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 :heavy_check_mark: (upper left area of answer).

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 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.

I had to same question as you did. About actions on buttons. I eventually want to make the database that I am making standalone so I am trying to avoide any macros if I can. Do you have a direct link t that Version 5 chapter 9 Documentation page. I have googled for it and cannot find it.

@Shaba1,

The link is provided in my answer already. Version 5 documentation in replaced with new versions. However, based upon your comment you do not want Chapter 9 which is about macros. You seem to want the actions you can attach to a button. This is a property of the button on the General tab.

If you have more questions, please ask as a new question.