'I'm developing a database with entry data forms in libreoffice Base, how can I hide the background app and show the forms and subforms only?

I don't want users can see the tables, bar menu, etc of main Base app, I need users only can see the forms and subforms to enter data or show reports from search queries at the database. Thanks!



Solution 1:[1]

Changing the visibility of any window is simple:

Sub setVisibleMainWindow(bVisible As Boolean)
    ThisDataBaseDocument.getCurrentController().getFrame().getContainerWindow().setVisible(bVisible)
End Sub

Only call this procedure when opening the form. For example, like this:

Sub openDefaultForm( )
Const MAIN_FORM_NAME = "DataForm"
    If ThisDatabaseDocument.FormDocuments.hasbyname(MAIN_FORM_NAME) Then 
        ThisDataBaseDocument.CurrentController.Connect() 
        ThisDatabaseDocument.CurrentController.loadComponent(com.sun.star.sdb.application.DatabaseObject.FORM, MAIN_FORM_NAME, FALSE) 
        setVisibleMainWindow(False)
    Else
        MsgBox "Something happened to the " & MAIN_FORM_NAME & " form!"+ chr(10)+"You deleted? Or renamed?" , 48, "Form not found"
    End if
End Sub

And don't forget to make this window visible before shutting down:

Sub beforeClose(oEvent As Variant)
    setVisibleMainWindow(True)
End Sub

Now use Tools - Customize - Events tab to assign the openDefaultForm() procedure as the database's "Open Document" event handler, and the beforeClose() procedure as the "Document is going to be closed" event handler for the form.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 JohnSUN