I have these macro that I wrote, its function is to update the values that are in the subform, to the table that it is linked to, when i click a button, something like saving, what I currently have, but I’m having a problem because it isnt working, and I dont know why, it just doesnt update the values at all.
Heres the macro:
REM ***** BASIC *****
Sub Salvar
dim SelecaoCheckState as string
mainform = ThisComponent.DrawPage.Forms.getByName("MainForm")
subform = mainform.getByName("SubFormUFM")
GuardaBox = subform.getByName("Guarda")
DiariaBox = subform.getByName("Diaria")
SelecaoCheck = subform.getByName("selecao")
SelecaoCheckState = SelecaoCheck.state
if SelecaoCheckState = 1 then
SelecaoCheckState = "true"
else
SelecaoCheckState = "false"
end if
SelecaoCheckStr = SelecaoCheck.BoundField.getString
GuardaBoxText = GuardaBox.Text
DiariaBoxText = DiariaBox.Text
DiariaBoxStr = DiariaBox.BoundField.getString
GuardaBoxStr = GuardaBox.BoundField.getString
if DiariaBoxText <> DiariaBoxStr then
DiariaBox.BoundField.updateString(DiariaBoxText)
end if
if GuardaBoxText <> GuardaBoxStr then
GuardaBox.BoundField.updateString(GuardaBoxText)
end if
if SelecaoCheckState <> SelecaoCheckStr then
SelecaoCheck.BoundField.updateString(SelecaoCheckState)
end if
End Sub