[Solved] New record already active when opening a form
Posted: Sun Jan 12, 2014 4:41 pm
Hello, how do you open a form with the new record already active? If possible without macros, thank you.
User community support forum for Apache OpenOffice, LibreOffice and all the OpenOffice.org derivatives
https://forum.openoffice.org/en/forum/
Code: Select all
Sub InitializeForm 'Form > Event > When Loading
Dim oForm As Object
oForm = ThisComponent.DrawPage.Forms.GetByIndex(0) '.GetByName("MainForm")
IF oForm.isloaded = false THEN Wait 100 'allows faster CPUs to continue while waiting for slower ones
' oForm.Last
' oForm.First 'this line along with .Last above leaves the total number of records in nav bar
oForm.MoveToInsertRow
End Sub Or a single click on some form button, toolbar button or Ctrl+PgDownDACM wrote:'Add data only' does restrict the Form to records added since opening the Form. To see all records while opening the Form to a new record will require a macro: