View Data Source as Table Command


Win10, LO6.4. HSQL backend

The Form Navigation Bar contains a show data source as table tool. As I turn off all the toolbars in Form View, I would like to just add this command to a standard macro button.
Anyone knows where I can find the corresponding command ?
Thank you


This code works as a toggle. Attach to a button. Click & table shown. Click again and table removed.

Option Explicit
Sub GetGrid
    Dim dispatcher As Object
    Dim oFrame as Object
	dispatcher = createUnoService("")
    oFrame = ThisComponent.CurrentController.Frame
	dispatcher.executeDispatch(oFrame, ".uno:ViewFormAsGrid", "", 0, Array())
End Sub

Interesting note. Question doesn’t mention sub forms or such. The Button is to be places on the Form or Sub Form which is to be displayed. The code remains the same for each. Where the button is placed is where the toggle takes place. So for a form with main and sub, two buttons - one on each and each connected to the same macro.

@Ratslinger Thank you.


Glad to be of help!