Using LO version 6.4.3.2 on a Mac I have a form which displays a query based on a dummy table with blank values and a corresponding table full of data.
When values are entered into the (sole) record of the dummy form, the search button refreshes the query and displays only records in the base table which meet the search criteria set in the dummy.
If I want to change or cancel the nature of the query, I can edit each of the search values manually, but I would like to use the single reset button (“Clear settings”) to empty these fields through a macro. Have tried to address them through the form controls:
SUB ResetForm 'Clears settings
DIM oForm as Object
DIM SearchBox as Object
oForm = ThisComponent.Drawpage.forms.getByName("MainForm")
SearchBox = oForm."txtReading"
msgBox "Reading set to : " & SearchBox.text
SearchBox.text = ""
oForm.Reload()
END SUB
The message box demonstrates that the routine gets a handle on the right object, but the next line has no effect.
I also tried addressing the underlying table directly:
SUB ResetForm2
DIM oForm as Object
UPDATE "T-St_types_dummy"
SET "Frame No." = NULL, "Direction" = NULL, "Reading" = NULL
oForm = ThisComponent.Drawpage.forms.getByName("MainForm")
oForm.Reload()
END SUB
But when compiling I get a stop at “Frame No.” - ‘Object not accessible. Invalid object reference.’
This is part of a beautiful database (of makers’ marks on pottery) that I wrote 25 years ago in the late lamented Paradox, and which I am trying to recreate in LibreOffice Base. Any advice would be gratefully received.