Cannot open a document from another database

Hello all:Is there a way to use an action button to open a document from another database

I tried this:

Dim Session As New NotesSession

Set ws = New notesuiworkspace

Set PurchaseDB = session.GetDatabase(SettDoc.PurchaseReqServer(0),SettDoc.PurchaseReqDB(0))

Set PurchaseView = PurchaseDB.GetView("NonInvHdrCompleted")

Set PurchaseDoc = PurchaseView.GetDocumentByKey(doc.RequestingSource(0))

Call uidoc.Refresh

Set PDoc = ws.editdocument(True,PurchaseDoc)

but I get this error

“In Correct argument type object expected”

is there any way to do it

thanks

Subject: cannot open a document from another database

Try this:

Dim Session As New NotesSession

Set ws = New notesuiworkspace

Set PurchaseDB = session.GetDatabase(SettDoc.PurchaseReqServer(0),SettDoc.PurchaseReqDB(0))

Set PurchaseView = PurchaseDB.GetView(“NonInvHdrCompleted”)

key = doc.RequestingSource(0)

Set PurchaseDoc = PurchaseView.GetDocumentByKey(key)

Call ws.editdocument(True,PurchaseDoc)

Good luck !

Subject: Did you try: Dim PurchaseDoc As NotesDocument ?