views:

9

answers:

1

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?

+1  A: 

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

Carlos
I think your answer solved 3/4 of my problem. I guess, if dateResponded is blank in the view, then the assignment to respondedDate fails with type mismatch. Seems odd, but a little checking plus your suggestion has me on my way. Thank you!
Kris.Mitchell