Error: "Nonexistent frame or frameset specified" when opening in same frame

  1. Application begins with a frameset, outline on left and embedded view on right (“main” frame).

  2. We want only one database or document window to be opened at any given time.

  3. The view is set to open it’s documents in the “main” frame (so as to replace the view which is in the same frame).

  4. When you open a document, it opens in the “main” frame.

5. I’ve got code in the post-open event of the doc to close the doc and re-open a different doc if a certain condition is true.

** PROBLEM **

I can’t seem to get any configuration of code to open the new document in the same frame as the original document. It either opens correctly with the “Nonexistent frame or frameset specified” error (which I can’t trap in code), or it opens the new doc on its own outside of the correct frameset.

Here’s my code:

Call uidoc.close(True)

Call ws.SetTargetFrame(“”)

Call ws.OpenFrameSet(“Main Home Page Notes”)

Call ws.SetTargetFrame(“main”)

Call ws.EditDocument(False, curdoc)

If I leave out the Call ws.SetTargetFrame(“”) statement, I still get the error, but it doesn’t open in the correct frame.

Is there any way to either get another doc to open in the same frame or to suppress the error message?

Thanks,

-Chris