Doc Locking Based on Field on QueryOpen

Good Day All,

I think I am brain farting on this one but would someone know how I can stop a doc (form) from opening from a view using the QueryOpen of the form. The formula in the query open at this point is:

project:= Project_Name;

role:=@UserRoles;

@If(@Contains(role;(project+“-Read”));@Success;@Prompt([Ok]; “Error!”;“You do not have access to view “+project+” files.”))

I tried @failure, but that doesn’t even throw the error message.

Any help would be appreciated as always.

Thank you,

Ken

Subject: Doc Locking Based on Field on QueryOpen

Did you try FILECLOSEWINDOW ?

Subject: RE: Doc Locking Based on Field on QueryOpen

The Form still opens when you use that command.