Base: Form events not being called

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Base: Form events not being called

Post by Villeroy »

Apart from database triggers and transactions (which belong to the realm of the currently used backend), most of the script event triggers do work for the forms and form controls.
I use database forms since OOo version 1 always avoiding any macros. If it requires a macro then it is either a design flaw, too complicated or not worth the effort to be implemented in OOo. I still don't see why a simple inventory database needs macros, triggers, transactions or anything like that.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Base: Form events not being called

Post by Villeroy »

ptoye wrote: I need macro code to keep an audit of when I change things.
A macro free draft about articles with changing colors and prices. The form lets you pick a date (default=today) and shows the price and colour for each selected article at the given date plus history of all changes.
Attachments
ChangingAttributes.odb
Articles with changing prices and colours
(30.91 KiB) Downloaded 170 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
ptoye
Posts: 225
Joined: Mon Apr 21, 2008 11:07 am
Location: Reading, England

Re: Base: Form events not being called

Post by ptoye »

Thanks, I'll look at this when I have some more spare time.

A first sight it looks as if the author (yourself?) is taking a different approach: having the update details in a form which then updates the base tables. My approach (I think more traditional) was to have the change in the record trigger (not in the technical sense) the recording of the update.

[Later] This is very interesting - a pity that Base isn't more self-documenting - it's quite hard work working out what some else's database does! Access is no better, but that's no excuse! It goes to show that I'm not really a very good database programmer (but I never claimed to be). The problem with my database is that as it started out as a simple spreadsheet, it needs a complete redesign to get it into a suitable format to use your techniques. Almost a case of "If you're trying to get there, I wouldn't start from here". But thanks very much for the very stimulating ideas.

But none of this answers my original question: why don't the events get called when one should expect them to be? I'd at least have expected a Record Action macro to be called when Base updates a record automatically. And Load macro when the form is loaded.
Peter
OO 4.1.1 on MS Windows 7 64-bit
Post Reply