Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass value from one form to another form.

Status
Not open for further replies.

troyu

Programmer
Nov 21, 2000
185
CA
Hi, I am trying to pass the "sent" value from one form to a user-defined field in a 2nd form. The value that I get in the 2nd form is

Fri 12/29/1899 12:00 AM

This is not correct. Any ideas why this value, and not the correct value is being passed? Code snipit below:

Sub cmdconfirm_click
Set MyNameSpace = Application.GetNameSpace("MAPI")
Set PublicFolders = MyNameSpace.Folders("Public Folders")
Set AllPublicFolders = PublicFolders.Folders("All Public Folders")
Set MyFolder = AllPublicFolders.Folders("Product Recalls")
Set MyItem = MyFolder.Items.Add("IPM.Post.Confirmed")
MyItem.Subject = "After Hours Product Advisory Confirmation"
MyItem.UserProperties.Find("OrigSentTime").Value = Item.Sent
MyItem.Post
Item.Close 1
End Sub
 
Uninitialized date variables default to
Dec. 30, 1899 12:00 AM on my machine


Dim dDate As Date
Debug.Print Format$(dDate, "Ddd MM/DD/YYYY HH:NN AM/PM")

returns "Sat 12/30/1899 12:00 AM"
 
Thanks Justin, appreciate the reply. I think I got it working another way however:

MyItem.UserProperties.Find("OrigSentTime").Value = Item.Sent

should be:

MyItem.UserProperties.Find("OrigSentTime").Value = Item.SentOn

The only change needed was that I needed to use "SentOn" instead of "sent".

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top