This originated out of the earlier SuperNTF integration requests. Because this edit button has some "unorthodox" logic behind it instead of a straight up @command([EditDocument]), it is interfering with the Queryopen logic introduced into the same subform to handle preview situations.
So my request is first to make this a boring @Command([EditDocument]) button, but since the only reason for the current button script logic is to tell users when they can't edit, how about we just hide the button altogether when a user can't edit the document? Here's the hide when formula for that:
REM {Hide if user has is not authorized to edit document};
curAccess := @TextToNumber(@UserAccess(@DbName; [AccessLevel]));
curAccess < 3 | (curAccess = 3 & !(@UserNamesList *= @Author))