I’m trying to create a from in LibreOffice Base where a subgrid is automatically updated whilst parsing a main grid (i.e. pressing up and down arrows or clicking on a field).
The form has:
- A grid with records from a tasks table.
- A Subform with a grid with records from a subtasks table. Tasks and subtasks tables are linked 1-n via task-ID field.
I tried with a macro linked to the tasks grid that identified the selected rows. The problem is that many can be selected.
Then I tried with another macro that identifies which row is the current one (green arrow) and gets the value on the task-ID field. This part seems to work, but if I assign the macro to pressing a key it works for most of them, but not the arrow keys.
dim oColumnList as object
dim oGrid as object
dim theValue as variant
oGrid=oEvent.Source.Model
oColumnList = oGrid.getByName(“Task-ID”)
theValue = oColumnList.getCurrentValue()
Print theValue
Then I still have to make the connection with the subtask grid… and I wonder if I’m in the right path or if there is an easier way to do it.