In Libreoffice base, I have one listbox control on a form which I use to have many to many relationship - I use it to select one or more workers which have been visited measuring station. Other controls on this form are bounded to data source of the form, but the listbox is not, since there is no automatism to achieve that. I populate all the data in listbox related table programmatically via basic.
I am just missing one final step - I want to trigger a macro for saving listbox data when current record is saved, current record is changed or form closed
I tried to use events “After records action” or “Before submitting”. It works when other data on form is changed. When only listbox contents are changed, macros do not trigger.
I tried to use isModified property of the form to change form state, so events are triggered.
set oForm = ThisComponent.DrawPage.Forms.GetByName("Obilasci")
' "obilasci" is name of the form with controls
oForm.IsModified = True
When trying to save form data, an error appears:
How to make this work ? One workaround I can think of is to create a dummy database column which will be changed when listbox content is changed, but I could not get it to work either.
Update: i got it to work with this workaround, by updating the control underlying data, but I wonder could it be done without it? Why isModified property is R/W and not only Read?