Emptying a field when the form is opened

Hi,I have a date field in my form. I want it to be emptied once the form is opened in read mode.

What code should I write and in which event - Postopen or Postmodechage ?

My code in Postopen is as below :


            Dim Fname As String

Dim Lang As String

Fname=source.FieldGetText("Untitled3")

If Not Fname="" Then

	'Call Source.FieldSetText("Untitled3","")

	'Continue=False

	Source.EditMode = True 

	Call Source.FieldSetText("Untitled3","")

	Continue=False

	Source.EditMode = False

End If

But this is not working. I am getting recurring save dialog box "Do you want to save changes ? yes / No ".

I have to choose Cancel to come out.I don want this dialog box to appear.

Pls advise.

Subject: Emptying a field when the form is opened

It is saving the document because you are changing edit modes

What should happen if the document is opened in edit mode? Should the value remain in the field?

Subject: RE: Emptying a field when the form is opened

No even in Edit mode the value should be set empty.

Subject: RE: Emptying a field when the form is opened

But the value should stay on the document when it is saved?

I am confused to your goal.

If the document is opened in read-mode, surely you should display the value if it exists in the document??

If the user switches to edit mode, then you obviously can clear the value from the field by putting the source.fieldsettext(fieldname, “”) code in the PostModeChange and QueryOpen events