Copying dates from form to form

I have a date field on form A (TEE_Meeting_Date) which I’m tring to copy to to the same field on form B, using lotus script. They all copy except for the date field. Script goes something like this…

Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Set db=session.CurrentDatabase

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc=workspace.CurrentDocument

Set doc=uidoc.Document

Set newdoc= New NotesDocument(db)

’ Call doc.CopyAllItems(newdoc)

newdoc.form = "Presentation"



newdoc.TEE_Meeting_Type = doc.TEE_Meeting_Type

newdoc.TEE_Meeing_Date = doc.TEE_Meeting_Date

’ newdoc.TEE_Meeting_Type_Mirror = doc.TEE_Meeting_Type_Mirror

’ newdoc.TEE_Meeting_Date_Mirror = doc.TEE_Meeting_Date_Mirror

’ newdoc.TEE_Meeting_Title = doc.TEE_Meeting_Title

Call newdoc.Save(True,True)

Call workspace.editDocument(False,newdoc)

End Sub

It’s a Date/Time, editable, Calendar/Time control format.

What am I missing? I KNOW I’ve done this before with script, just can’t get it working now.

Thanks,

Angelo Giaimo

Subject: Copying dates from form to form

Not sure if this is the reason but I see a typo…

newdoc.TEE_Meeing_Date = doc.TEE_Meeting_Date

should be:

newdoc.TEE_Meeting_Date = doc.TEE_Meeting_Date

the “t” in the first meeting is missing…

Brent

Subject: This may be silly but…

…did you notice the field name was spelled incorrectly in your code?

“newdoc.TEE_Meeing_Date = doc.TEE_Meeting_Date”

should be…

“newdoc.TEE_Meeting_Date = doc.TEE_Meeting_Date”

I know that you are probably aware of this, but just something I noticed straight off.

Otherwise, you may use some different code. Something like…

Set item = doc.GetFirstItem( “TEE_Meeting_Date” )

Call item.CopyItemToDocument( newdoc, “TEE_Meeting_Date” )

Hope that helps!

T.

Subject: Copying dates from form to form…Fixed

Thank you both for pointing out the typo. Looks like I overlooked the obvious! I was convinced it had something to do with using calendar/time control format rather than notes format, or some variable setting.

Thanks again,

Angelo Giaimo