Setting a newUIDOC to a newDoc from a CopyToDatabase

Good Day Folks,

I am struggling with a little challenge today.

I am attempting from a current open (not in edit mode) uidoc to make a child uidoc to edit a request and make amendments. The source thus far is as below.

Where I am stuck is trying to set the uidoc or a new uidoc to be the new doc and place that new uidoc into the current session window.

Any recommendations would be strongly appreciated.

Sub Click(Source As Button)

'****************************************************************************************************************

'To Amend a Pending Request

'****************************************************************************************************************

Dim db As NotesDatabase	

Dim session As New NotesSession

Set db = session.CurrentDatabase	

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim newuidoc As notesuidocument

Dim doc As NotesDocument

Dim newdoc As NotesDocument

Dim item As NotesItem

Dim tmpSaveOptions As String

Dim unidnew As String*32	

Dim unidold As String*32	

Set uidoc = ws.CurrentDocument

Set doc = uidoc.Document



Set newdoc=doc.CopyToDatabase(db)



unidold = doc.UniversalID

unidnew = newdoc.UniversalID

Set item = doc.ReplaceItemValue("ChildDoc", unidnew)

Set item = newdoc.ReplaceItemValue("ParentDoc", unidold)

Thank you,

Ken

Subject: Setting a newUIDOC to a newDoc from a CopyToDatabase

Set uidoc = ws.EditDocument(True, NewDoc)

Subject: RE: Setting a newUIDOC to a newDoc from a CopyToDatabase

Thank you sir…

Some days I can’t figure out how to tie my shows, but I can explain the theory of relativity in plain klingon.

nuqDaq ‘oH puchpa’‘e’

Ken

Subject: RE: Setting a newUIDOC to a newDoc from a CopyToDatabase

Glad to see it worked for you.

nuqjatlh?