Open docs with different form in Frames

Hi All. I am attempting to write code that will open 2 documents into 2 frames on a frameset. We will use this for Quality Control to compare the 2 documents, side-by-side. I want to open them each with a form that’s not the form they are saved with. I will then have a “Form” field on the new forms to save them back to the original form. What happens is that “doc1” opens correctly in the left frame (QC1) with the new form (QC1). However, doc2 still opens with the original form in the right frame (QC2). Also, the framset does not specify any content. The 2 forms, QC1 and QC2 do specify to launch in frame “QC” and frameset “QC1” and “QC2” for each form. Below is my code that I have in an agent. Any insight is appreciated. I’m also open to any other ideas on how to split screen to compare 2 docs side-by-side. Thanks very much in advance.

Jason

Dim ws As New NotesUIWorkspace
Dim collection As NotesDocumentCollection
Dim collection2 As NotesDocumentCollection
Dim dc As NotesDocumentCollection
Dim doc1 As NotesDocument
Dim doc2 As NotesDocument
Dim uidoc As NotesUIDocument
Dim uidoc2 As NotesUIDocument
Dim db As NotesDatabase
Dim session As New NotesSession
Dim filePath As String

Set db = session.CurrentDatabase
filePath = db.FilePath
server = db.server
viewName = “BGTrackQC”

Set collection2 = ws.PickListCollection(1, False, server, filePath, viewName, “Select Requests”, “Please select request to open in Frame 1”, “”)
Set doc2 = collection2.GetFirstDocument
If doc2 Is Nothing Then Exit Sub

Set collection = ws.PickListCollection(1, False, server, filePath, viewName, “Select Requests”, “Please select request to open Frame 2”, “”)
Set doc1 = collection.GetFirstDocument
If doc1 Is Nothing Then Exit Sub

doc1.Form=“QC1”
doc2.Form=“QC2”

Call ws.SetTargetFrame(“QC1”)
Set uidoc = ws.EditDocument(True, doc1, False, “”, False, True)

Call ws.SetTargetFrame(“QC2”)
Set uidoc2 = ws.EditDocument(True, doc2, False, “”, False, True)

Exit Sub

ErrorHandler:

Print Error & " - " & Err
Resume Next

Subject: * SOLUTION *

I found the solution to the problem. I just had to save the uidoc2 doc after I changed the form name, and before I opened it. Weird that I only had to do that on the second one, and not the first one.

Jason