Macro to Save and Close Base

Hi, I’m writing a Base DataBase with a fairly standard layout, it has a “Switchboard” form with buttons which allow users to navigate around the DB. What I would like to add is a button on the switchboard that allows users to Save and Exit the DB automatically. Obviously a Macro, but I am having trouble finding any code examples, if anyone can help or suggest a code source it would be appreciated. I’m running LO 6.2.2.2 (64 bit) on Windows 10 with Base (Firebird) The Switchboard form is called “FRM_SWITCHBOARD” and the DB is “DPT”. Any help gratefully appreciated.

Hello,

Are you using this Switchboard form as a standalone - Base is not actually opened? If so there are severe problems with doing this.

Thanks for a reply. No Base is running the Switchboard is just a normal form, in the final version the Main Base screen will be hidden.

Hello,

Have something for you to work with. The main issue with using Firebird is the need to perform a Save or changes will be lost. This can be done using ‘dispatcher’. Then a matter of closing Base.

However there is also another situation. With the above, there is no check if a change was in process. Have attached a sample with macro (one simple form). The macro first checks if a modification is in process. If so, it presents a message to the user and when clicked presents the form again. If no change in process, all is closed. You may want to make your own decisions in this area. Just presenting a method here.

Sample ---- FirebirdCloseSaveMacro.odb

Hi Thanks for the answer very helpful got me on the right track and sorted it out.

Cheers