In LibreOffice Base, How to write a button macro that will open different form to a specific PrimaryID?

In LibreOffice Base, How to write a button macro that will open different form to a specific PrimaryID?

In LibreOffice Base, How to create a macro for a button that reads an ID field from the current record then uses this ID to open a different form to the record with ID = PrimaryID?

I’m using LibreOffice 5 with Windows 8.1

Would be nice if somebody would add this to the official documentation under macros.

You could use the learning of this answer (how to open form and and navigate records). Create a control that displays the PrimaryID of the record, call the control in an object variable (look for answers that use ThisComponent or ThisDatabaseDocument as a starting point) the value being ControlObject.Value, then create a recordset using a query limited to that id or engage in a math exercise of counting how many records are earlier or later and browsing in the full recordset to that record. Or apply a filter like in the linked answer.