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.