Ask Your Question
0

Update db form right after it's done loading

asked 2019-12-11 18:07:22 +0200

Geert Janssens gravatar image

I have created a form in LibreOffice Base. Some form fields need to be manipulated each time I change to another record. For example there's a field that holds the name of an image. When the record is shown, this name is used to display this image at true size in another field. I have a python macro that is connected to the "After Record Update" event for this.

It works well, except when the form is first loaded. When loading the form the "After Record Update" event is not triggered for the initial record to show. Looking at the form's available events I thought perhaps to attach the same code to the "When Loading" event. This fails however because at that stage the form's DrawPage is not yet available so I can't go in and edit form controls.

So I'm a bit at a loss here. What event should I listen for to be able to change form controls right after the form has loaded ?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-12-11 20:17:09 +0200

Ratslinger gravatar image

Hello,

You are in the wrong area. You seem to be looking at the events for an internal form and should be looking at the external form events.

Edit the form you want the update to occur on when opening. From the menu select Tools->Customize.... Then on the Events tab attach your macro. Most often what works is the Open Document event. In some cases you may need to use the View Created event. Document loading finished may also work.

Unfortunately do not seem to have any list of descriptions for these. If found will post.

edit flag offensive delete link more

Comments

It never occurred to me there would be a higher level for these events.

Thanks a lot. That solved my issue.

Geert Janssens gravatar imageGeert Janssens ( 2019-12-16 19:28:15 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-12-11 18:07:22 +0200

Seen: 49 times

Last updated: Dec 11 '19