When ever I open a form, regardless of the dimension of the actual data displayed it always opens in a window that occupies most of the screen. Is there any way that I can specify the “page size” that is displayed on screen? i.e. if the table I am displaying is only 2" wide and 3" high then all I really want is a window that will encompass that, not one that encompasses almost the entire screen.
Running LibreOffice Base in Linux
Edit 2019-10-03 By @Ratslinger (Comments moved here to enhance question and improve readability):
That works great with my Main Form, however, whenever I call another form (I have buttons that close the main form and open a new one via macro) the newly opened form throws a “BASIC runtime error. Object variable not set” message. Yet, when I close the new form and return to the Main one (again via macro) it works fine.
open form designer opens the secondary form which fails. OpenAllForm opens the master form and works as intended CloseAllForm closes the Master in preparation for opening the designer. All the extra code in all of this is just so I can return to the last record I was viewing.
Sub OpenFormDesigner
CloseAllForm
ThisDatabaseDocument.FormDocuments.getbyname("frmDESIGNER").open
Resize(100,200,500,1000)
End Sub
Sub CloseFormDesigner
Dim oForm
oForm = ThisComponent.DrawPage.Forms.getByIndex(0)
oForm.updateRow()
oForm.First()
ThisDatabaseDocument.FormDocuments.getbyname("COUNTRY").open
ThisDatabaseDocument.FormDocuments.getbyname("frmDESIGNER").close
End Sub
Sub OpenAllForm
Dim oForm 'Reference to the primary record.
Dim oSubForm
Dim CurrRecord 'Record Number saved
Dim lFlag, mFlag
' CurrRec = stored value
Resize(710,465,940,560)
oForm = ThisComponent.DrawPage.Forms.getByIndex(0) ' Main Form
oForm.Absolute(9) 'takes me to a specific record number
WAIT 200
oSubForm = oForm.GetByName("Stamp") 'SubForm Name
WAIT 100
lFlag = oSubForm.findColumn("SM_FLAG")
mFlag = oSubForm.getString(lFlag)
CurrRecord = oSubForm.getRow() ' returns the current record number
oSubForm.updateString(lFlag, CurrRecord)
End
Sub CloseAllForm
Dim CurrRecord 'Current record number
Dim oForm 'Reference to the form containing the primary record.
Dim oSubForm 'Reference to the subform containing the data
Dim CurrRec 'Record Number saved when form was last closed
Dim lFlag
oForm = ThisComponent.DrawPage.Forms.getByIndex(0) 'Main Form
oSubForm = oForm.GetByName("Stamp") 'SubForm Name
' oSubForm.updaterow()
WAIT(200)
CurrRecord = oSubForm.getRow() 'returns the current record number
oSubForm.first() 'Return to start
lFlag = oSubForm.findColumn("SM_FLAG")
oSubForm.updateString(lFlag, CurrRecord)
oSubForm.updaterow()
WAIT(200)
oForm.parent.parent.CurrentController.Frame.close(true)
End Sub