Why filled field with macro doesn't stock in database?

I’ve made a macro to get information about the user to autofill two fields, name and last name. It works and display the information in the fields. In my form, they are both linked a field in the database. My issue is that when I save my form, the data written in those two fields doesn’t stock in the database. Do I have to make something special in my macro to let the form know that the field isn’t actually empty ?

This is the macro

Sub getMotherFirstName
Dim oFormDocs,oCallFormDoc,oForm,oComponent as object
Dim valueData As String
oForm =thisComponent.Parent.FormDocuments

rem ThisComponent.Drawpage.Forms.getByName("Form").getByName("Boxtest").Text = "hey you "
rem valueData = ThisComponent.Drawpage.Forms.getByName("HomeForm").getByName("Boxtest").getCurrentValue()
if oForm.HasByName("F_HOME") then 
  oForm = oForm.getByName("F_HOME")
  valueData = 
  oForm.Component.DrawPage.Forms.getByName("HomeForm").getByName("prenom_box").getCurrentValue()
  ThisComponent.Drawpage.Forms.getByName("Form").getByName("prenomMere").Text = valueData
  getMotherLastName
End if
End Sub

Also posted at libreoffice base - Filled field with macro doesn't stock in database - Stack Overflow.

You have to .commit() the changed field(s) to the form.
An updateRow() will store the current (changed) row to the database.

If your changes may result in other changes, perhaps filters or sub-form you may consider field.refresh() or/and to .reload() the form.

(It is described in the handbook for Base, but I have only the german version here, so I can only suggest to search the chapter on macros for the functions mentioned above in your language.)