Mail - script modified fields not saved (more data)

Hi

I have a subform on a Reply form in a mail-in database.

The subform contains some special functions and includes a routine with which a categories field is set on the original message of the reply.

All goes well when debugging the code on the subform, including a Save action on both the reply document and the original message document on changing the category, but when the focus returns from the subform to the core mail classes the data are not retained and when the documents are closed nothing has been saved… ???

How can I embed my extra code (script library calls in subform events) in such a way that the calculated data are retained until a Save action can properly be performed?

Some relevant pieces of code:

…strResponseCat = docMessage.ResponseCategories(0)

…If strResponseCat = “” Then

…strResponseCat = GetResponseCat(Source)

[…]

…Set Item = docResponse.GetFirstItem(“PostedDate”)

…Set dateResponded = Item.datetimevalue

…'calculate the response time

…If xHolidays = “” Then

…strFormula$ = {@BusinessDays([} & dateAdjusted.DateOnly & {];[} & dateResponded.DateOnly & {];1:7)}

…Else

…strFormula$ = {@BusinessDays([} & dateAdjusted.DateOnly & {];[} & dateResponded.DateOnly & {];1:7;} & xHolidays & {)}

…End If

…varDays = Evaluate(strFormula$)

…iResponseDays = varDays(0)-1

…'Fill the ResponseInfo on the response document

…Call docResponse.ReplaceItemValue(“ResponseDays”, iResponseDays)

…Call docResponse.ReplaceItemValue(“ZeroDate”, dateAdjusted)

…Call docResponse.ReplaceItemValue(“DateReply”, dateResponded)

…Call docResponse.ReplaceItemValue(“ResponseStatus”, “Behandeld”)

…Call docResponse.ReplaceItemValue(“ResponseCategories”, strResponseCat)

…Call docResponse.Save(True, False)

When debugging, the docResponse items show the changed data at this point. But when returning to the form’s events, the fields show unchanged data.

(more info…)

  1. The (test)server is very slow.

  2. It takes a very long time before the results the “Before new mail arrives” are visible in a newly arrived mail.

  3. Focusing between documents in the inbox when preview is open is very slow.

  4. Sometimes, the menu options disappear and do not become available until the database is closed and opened again.

  5. Sometimes, nothing happens when you click on another view.

  6. I am not certain if the problem described above is caused by the lack of server speed, or if the speed and the problem with saving the new data have a common cause.

Any help with solving this problem is greatly appreciated.