Page 1 of 1

[SOLVED] Reload form but stay on current record

Posted: Tue Jan 28, 2020 1:07 pm
by MHCom
Hi,

I have a simple macro assigned to a push button to change allowupdates to "true", but for it to work it needs to reload the form. When the form is reloaded it goes back to the first record but I need it to stay on the current record. Is there a way of doing this?

Re: Reload form but stay on current record

Posted: Tue Jan 28, 2020 7:29 pm
by F3K Total
Try this:

Code: Select all

Sub Reload_Form_keep_current_Row
    oForm = ThisComponent.DrawPage.Forms.getbyName("MainForm")
    nRow = oForm.Row
    oForm.reload 'reload form
    oForm.Absolute(nRow) 'set the cursor back to previous current row
End Sub
R

Re: Reload form but stay on current record

Posted: Wed Jan 29, 2020 11:44 am
by MHCom
Perfect, thank you!