Activating the last entry in a view and automatically edit this document

Hi,

I’ve a problem:

I use a frameset with two frames: a view and a form.

I want to active the last entry in a view, which does the following code:

    Set uidoc = uiWS.CurrentDocument

Set db = session.CurrentDatabase

Set uiview = uiWS.CurrentView

Set view = db.("view")

Set doc = view.GetLastDocument

Call uiview.SelectDocument(doc)

And now I have the problem, that the doc isn’t in the form activated.

    Call uidoc.EditDocument

doesn’t work, because this opens a new tab.

How can I solve this problem ?

Best regards,

Bernd