Problems with Doc.save(True,True),doc is not saved or is lost if it has been saved

HI,I have a LotusScript programs for uploading the Notes documents to one of my company’s internet folder,parts of codes will generate the unique group number for every day’s uploading,the codes is sample, it will create a new notes document with a group number, then next uploading will increase one according the previous number, the whole process works fine for a long time, but I got problem today. It seems the parts of generating group number is not working properly. The document is not saved, the result is that I got same group number for two uploading process.

It seems the generating group number document is not saved in the system.

How can make sure the memo.save(true,true) is really saved?

Thanks,

This is the parts of codes which saves the group number document.

Set memo = LookupDB.createdocument

memo.form="Memo"

memo.subject = subjectStr

Set rtitem = memo.CreateRichTextItem("Body")

Call rtitem.Appendtext("Please click this attachment to view the Invoice Comma Delimited file")

memo.DateGenerated = Format(Date,"yyyy-mm-dd")

memo.ControlNo = controlNoStr

Set object = rtitem.embedobject(EMBED_ATTACHMENT,"", filename)

Call memo.save(True,True)