NotesDateTime and ERROR

Hi all,

I have within form the field “CreatedField” as Date/Time fiel, Computed as compose, and there is the formula @now

I have some agent that get this content of date,

Dim createdVar As NotesDateTime

Set createdVar = New NotesDateTime(doc.CreatedField) 'ERROR HERE: Variant does not contain a container

Could you help me what have I to do to fix it?

Thank you very much,

Subject: RE: NotesDateTime and ERROR

I think you’re mistaken about where the error is occurring.

The error “variant does not contain a container” reports that you used a variable in a Forall statement which isn’t an array or list. There might be other statements that might generate the same error, but the NotesDateTime constructor and assignment here, neither of them require a container. The NotesDateTime constructor is looking for a string. The assignment is looking for a NotesDateTime – both scalars.

I might also point out the NotesItem.DateTimeValue property, which is a more efficient way to assign your variable.

Subject: NotesDateTime and ERROR

doc.CreatedField(0)

Subject: RE: NotesDateTime and ERROR

Thank you Randy, but I´ve put it doc.CreatedField(0), and the error is occuring.

Do you have other idea?

Subject: RE: NotesDateTime and ERROR

It sounds like your “doc” object is not getting set or your CreatedField is blank - add some error checking and step through your code in debugger to see if Doc is getting instantiated.

if Doc is nothing then

'do nothing

else

'do something

End if

If Doc.HasItem(“CreatedField”) then

'do something

End if