Reset a field Value in Read Mode

Hello forumI have a document when a change field Prject_Status to BAU mode blocks for Edit, is normal it’s design to do it, for this i use:

Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant)

If mode And Not IsNewDoc Then 

	If Source.Document.Prject_Status(0) = "BAU" Then

		Messagebox "You may not edit a closed project."

		continue = False

	End If

End If

End Sub

Sub Querymodechange(Source As Notesuidocument, Continue As Variant)

If Not source.editMode Then

	If Source.Document.Prject_Status(0) = "BAU" Then

		Messagebox "You may not edit a closed project."

		continue = False

	End If

End If

End Sub

So good till now is working perfectly, but i want to reverse this also, i mean to reset value of Prject_Status filed in order to go back in Edit mode

Thanks for your help

Subject: Changing the value of a field in read mode.

Sub Querymodechange(Source As Notesuidocument, Continue As Variant)If source.editMode Then

If Source.Document.Prject_Status(0) = “BAU” Then

Messagebox “You may not edit a closed project.”

continue = False

End If

End If

if source.editMode == False Then

if source.document.Project_Status(0) != “” Then

source.document.Project_Status = “”

end if

call source.document.save(true, false)

End Sub

I haven’t tested this, but the idea is sound. You make the check in revers (and you do the blank check simply to avoid updating an empty field with another empty field).