This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
You need to initialize the dTime variable to a valid date/time before you can adjust it.
The reason why your code fails is that you initialise the dTime variable with the following line
Dim dTime As New notesDateTime("")
which effectively creates an invalid NotesDateTime instance. Later in your code, the line
Call dTime.AdjustDay(adjustD(0))
then has no effect. (I'd actually prefer it if an error was raised, but it seems that NotesDateTime.AdjustDay() is implemented such that it just fails silently.)
I assume that with (also from your code)
Call doc.ReplaceItemValue("dTime",temp2(0))
you are intending to initialise the dTime variable to the date and time stored in temp2(0). However, that does not work, since the only thing that the dTime item on the document and the dTime variable have in common is their name -- apart from that they are two completely different animals.
If you replace that by
dTime.LSLocalTime = temp2(0) 'assign value of temp2(0) to the dTime variable
dTime.AdjustDay(adjustD(0)) 'adjust date/time stored in the dTime variable
Call doc.ReplaceItemValue("dTime", dTime) 'assign value of the dTime variable to the dTime item
then it should work as intended.
Feedback response number JSAK98VCYH created by ~Tip Zekjumitexakol on 06/21/2013