[SOLVED] Reload form but stay on current record

Creating and using forms

[SOLVED] Reload form but stay on current record

Postby MHCom » Tue Jan 28, 2020 1:07 pm

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?
Last edited by robleyd on Wed Jan 29, 2020 1:21 pm, edited 2 times in total.
Reason: Add green tick
OpenOffice 4.1.5 on Windows 7 Professional
MHCom
 
Posts: 16
Joined: Fri Nov 08, 2019 4:55 pm

Re: Reload form but stay on current record

Postby F3K Total » Tue Jan 28, 2020 7:29 pm

Try this:
Code: Select all   Expand viewCollapse view
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
    MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
    my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
F3K Total
Volunteer
 
Posts: 983
Joined: Fri Dec 16, 2011 8:20 pm

Re: Reload form but stay on current record

Postby MHCom » Wed Jan 29, 2020 11:44 am

Perfect, thank you!
OpenOffice 4.1.5 on Windows 7 Professional
MHCom
 
Posts: 16
Joined: Fri Nov 08, 2019 4:55 pm


Return to Forms

Who is online

Users browsing this forum: No registered users and 3 guests