Doc.save returns True, but doesn't write a document

I have a very strange problem, where a straight-forward Save should work, seems to work, but the documents simply disappear. Can anyone suggest what’s wrong with this snippet of code …

…first, check if the doc exists, and if not, create a new object

Set param_doc=Param_view.GetDocumentByKey(types)

If Not(param_doc Is Nothing) Then

.Print “found it” + types(i,0,0)

Else

.Print “creating new” + types

.Set param_doc=db.CreateDocument

End If

I ALWAYS get the message “creating new” with the right key

now the write logic …

param_doc.wKey=FieldName

param_doc.wPrompt=Prompt

param_doc.wOptions=Options

param_doc.wpermissions=permissions

param_doc.wDefaults=defaults

param_doc.Form=“Param”

flag= param_doc.Save(True,False)

Messagebox “Flag=” & Str$(flag)

Flag ALWAYS = -1 (which means it worked), but there’s no new document. Total number of documents in the database doesn’t change, so it’s not a question of view selection or anything simple.

One more clue - it’s working in a new database, but doesn’t work in my Mail database.

I will appreciate any help.

Subject: doc.save returns True, but doesn’t write a document

Did you try to CALL the save?

Like so:

Call param_doc.Save(True,False)

Subject: RE: doc.save returns True, but doesn’t write a document

Thanks.

That’s how I normally code, and the same (no)thing happens. I tried the flag= method to be sure that the call is working.

Any other ideas?

Subject: RE: doc.save returns True, but doesn’t write a document

Is there a SaveOptions field in your form? If it’s set to “0”, eventhough your code is fine, it won’t save it.

Subject: doc.save returns True, but doesn’t write a document

How is db getting set. Could it be that it is pointing to another database so the new document gets created there?

Subject: RE: doc.save returns True, but doesn’t write a document

Thanks, but not possible …Dim session As New NotesSession

Dim db As NotesDatabase

Set db=session.CurrentDatabase

Set Param_view=db.GetView(“Parameters”)

If (Param_view Is Nothing) Then

…Messagebox “Empty view”

…Goto exitproc

End If