If I understand your goal correctly you are updating doc 1 with an “id” from doc 2 and vice versa so that from either doc you can directly access the other?
If so, it looks like a simple bug in your code where you don’t update entrydoc with the id from sizedoc. You appear to update 2 fields in sizedoc from fields in entrydoc:
sizedoc.docno = entrydoc.docno(0) (when sizedoc not found)
sizedoc.SizeDocNo = entrydoc.SizeDocNo(0) (after copying all entrydoc items into sizedoc)
but nowhere do you update entrydoc with a reference back to sizedoc so I am guessing that the last section of code generally doesn’t work?
Please clarify which field on each form is the key field used in each of the views “SizingDocs” and “SizingEntryDocs”. It’s a bit hard to follow otherwise.