One of the fields is a list box.
When I choose an item from the list, that is when I click on an item from the list, I want the data to be immediately saved in the table, without having to move to another record (clicking on another record in the grid).
I have easily managed that putting the code in a button:
Code: Select all
Sub btn_saveRecord(oEvent As Object)
dim MainForm, SubForm as object
MainForm=thisComponent.drawpage.forms.getByName("MainForm")
SubForm=MainForm.getByName("SubForm")
if SubForm.isnew then SubForm.insertRow() else SubForm.updateRow()
End Sub
The only difference I can see is that when I click the button, focus moves from list box to button...