Ask Your Question
0

Macro to Save and Close Base

asked 2019-05-21 11:24:23 +0100

JohnnyG gravatar image

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.

edit retag flag offensive close merge delete

Comments

Hello,

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

Ratslinger gravatar imageRatslinger ( 2019-05-21 18:41:12 +0100 )edit

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.

JohnnyG gravatar imageJohnnyG ( 2019-05-21 21:00:05 +0100 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2019-05-21 22:36:46 +0100

Ratslinger gravatar image

updated 2019-05-21 22:37:42 +0100

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

edit flag offensive delete link more

Comments

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

Cheers

JohnnyG gravatar imageJohnnyG ( 2019-05-23 09:19:54 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-05-21 11:24:23 +0100

Seen: 92 times

Last updated: May 21