Question

I have a couple of dates stored in a view. And I am using getItemValue to retrieve them.

Dim repsondedDate As NotesDateTime
Set repsondedDate = timePart1doc.GetItemValue("dateResponded")

When I try to do the following, I get a type missmatch at run time.

Dim dateDifference As double
Set dtLocal = New NotesDateTime( Now )
dateDifference = repsondedDate.Timedifference(dtLocal)

Does anyone have any ideas on what is going wrong?

Was it helpful?

Solution

The following line returns an array:

Set repsondedDate = timePart1doc.GetItemValue("dateResponded")

So it should be:

Set repsondedDate = timePart1doc.GetItemValue("dateResponded")(0)

If I'm not mistaken you should be using the GetItemValueDateTimeArray method instead of the GetItemValue, so it should actually be like this:

Set repsondedDate = timePart1doc.GetItemValueDateTimeArray("dateResponded")(0)

Hope that helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top