Dynamic filtering of a form / desire to change the content of the form.ActiveCommand

The form.ActiveCommand contains the SQL used to determine the content of the form, it is readonly.
I would like to present data in a form in various ways (the table as a whole, in a one to many relation as a left outer join, …). The form content is based on a query. On the form are a few buttons to change the SQL of the query, subsequently the form.reload() command is executed.
However: the contents of the form(“MainForm”).getByName(“MainForm_Grid”) is not updated. After closing the form and reopening, the change in SQL of the query becomes visible.
Is there a dynamical method to do this without closing/opening the form.

dbConnection.getQueries().getByName(qry_name).Command = SQL  # write SQL
oForm.getByName("filtersetting").ListSource = [SQL, ]
oForm.reload()

In hindsight it is questionable whether the form reloads at all: the queryname is not changed and the forms filter either. By changing the form filter, the form can be forced to reevaluate the records to display, and, on the fly, it becomes aware of the changed SQL written to the query. The tric is to to set a filter that is true for all records. The code as a schetch now reads:

def change_form_ActiveCommand(oEvent):
     # virtually change forms activecommand by changing a querySLQ
      oForm = oEvent.Source.Model.Parent

     button_name = oEvent.Source.Model.getName()

     dbConnection = oForm.ActiveConnection

    # put the query SQL here, depending upon button control name
    SQL = ..............

    dbConnection.getQueries().getByName(qry_name).Command = SQL  # write SQL

    # set the ListSource of a listbox control identical to SQL query
    # the event modified can be tied to a macro to filter form of jump to
    # cooresponding record in the tablecontrol

    oForm.getByName("CtlFilter_setting").ListSource = [SQL, ]

    if oForm.Filter == "":
        oForm.Filter = f'("tblapparaat"."id" > -1)'
    else:
        oForm.Filter = ""
    oForm.ApplyFilter = True

    oForm.reload()