I have an application which if a user is a level of Author and the status is at a certain level should automatically revert the document into Read mode even after they edit the document. I have added the following code to the QueryModeChange event of the form but I get the error -
“Attempt to Execute Nested Form Events”
When the user clicks on OK, the form does revert to read mode but how can I get rid of this message and what does it mean?
My code is simple:
If Source.EditMode=True And Status =“Review” Then
Source.EditMode=False
End IF
This is really bugging us and would appreciate any help to resolve this. Thanks.
Subject: Automatically Switching to Read Mode on document open
You are trying to change the mode in the QueryModeChange, which calls the QueryModeChange. Why not simply remove the user/role from the Authors field when the status hits Review? If you absolutely have to use events, then use the QueryOpen and QueryModeChange to check the edit mode, and set Continue = False in both cases.
Subject: RE: Automatically Switching to Read Mode on document open
Hi Stan, thanks for this. I can’t seem to force the users to view documents only in Read mode based on this.
Always seems to open in Edit
Subject: RE: Automatically Switching to Read Mode on document open
Do you have “Automatically enable edit mode” selected in the “On Open” section of the second tab in the form properties dialog box??
Charlie