I currently have a macro which when run from one form opens another form and inserts a new record into it. I now need this macro to go to the newly opened form and go to the new record created (ie. the last record). One way to do this is to place a new macro to run on the launch of the newly opened form to 'go to last record'. This works fine, unless the form is already open. If already open, it does not refresh and does not go to the newly created record.
The record macro function provides the following:
Code: Select all
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Refresh", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:LastRecord", "", 0, Array())
If you can understand this issue and can help, much appreciated.
Thanks