From what I can tell you're creating the document, doing some validation when it's opened then closing it if it doesn't pass without letting the user edit it
Seems a bit backward to me - why not do the validation before even opening the document - if it fails never open it, if it passes open the uidoc and let the user interact with it.
doc.form = "LoadRequests"
call doc.replaceitemvalue("LRReqDate", datNew.DateOnly)
if not viewvalidate(datNew, doc, 1) then
msgbox "Cannot create doc, dates wrong"
set uidoc = ws.EditDocument(True, doc, False, ,True, False)