QueryModeChange (NotesUIDocument - LotusScript®)

Occurs just before the current document changes modes (from Read to Edit mode, or from Edit to Read mode).

Defined in



QueryModeChange( Source as NotesUIDocument , Continue as Variant )



NotesUIDocument. Read-only. The current document.


Boolean. Read-write. Indicates whether or not the document will change modes. Initially set to True. Set this parameter to False if you do not want the document to change modes.


When you create a script that responds to this event, Domino® creates the syntax of the event for you (including the parameters). You do not need to type it in.

Use the EditMode property on Source to determine the current mode (before changing).

The Querymodechange event only controls switching to edit mode after a document is already open. To prevent users from opening the document in edit mode from a view, use the Queryopen event.

Note: Querymodechange and Queryopen should not be used for security. LotusScript® code cannot prevent determined and knowledgeable users from modifying a document if they have access to it. For example, they can use toolbar icons containing FIELD statements or, if they have a Domino® Designer client, write their own LotusScript® code to bypass your form design. If it's important to prevent editing, use Authors fields.