Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello,

You can set a form to allow entry of new records only which then always displays a new record.

Open your form in edit mode. On the Form Design toolbar, there is an icon for Form Navigator, click that. Right mouse click your form name and select Properties. On the Data tab, set Add data only to Yes. Save the changes.

If you want to have all records available but still be positioned on a new record, you need to use a small macro:

Sub GoToNewRecord()
    Dim oForm As Object
Rem Get the internal form
    oForm = ThisComponent.Drawpage.Forms.getByName("YOUR_INTERNAL_FORM_NAME")
Rem Set records to be loaded
    oForm.FetchSize = 5000
Rem Move to insert row record
    oForm.moveToInsertRow()
End Sub

You will need to supply your internal form name (most likely 'MainForm'). This routine is attached to the When loading event of the internal form. For more information on LO macros see the documentation -> LibreOffice Base Handbook. Look in Chapter 9 - Macros.