Creating Task using Access Database (2007)
Posted on 2012-08-15
I need help in fixing code so I can view an Outlook Task created from an Access 2007 database before assigning the task and sending it. (current code is below)
I have a database that is for tracking action items. When you create an actions item in Access, I want to be able to create a task in Outlook and send the task to the person assigned. Using the code below, I can create the task, but only assign it to myself. I need to be able to assign to to another staff member. I do have a field for "Assinged To" in my database, but it may not be the same spelling as in the Outlook directory.
Is there a way to create the task in Access, but view the task before sending it? This would allow me to choose the person assigned from the employee directory and then send the task.
Current Code Used:
Private Sub Command63_Click()
Dim appOutLook As Outlook.Application
Dim taskOutLook As Outlook.TaskItem
Set appOutLook = CreateObject("Outlook.Application")
Set taskOutLook = appOutLook.CreateItem(olTaskItem)
.StartDate = Me.Start_Date
.StatusReport = True
.Subject = "You have been assigned task:" & Chr(1) & Me.Action_Item_Number & Chr(2) & Me.Task_Name
.Body = Me.Description_of_Task
.ReminderSet = True
.ReminderTime = DateAdd("n", 2, Now) ' Set to remind us 2
' minutes from now.
.DueDate = Me.Date_to_Complete ' Set the due date to
' 5 minutes from now.
.ReminderPlaySound = True
'add the path to a .wav file on your computer.
.ReminderSoundFile = "C:\Win95\media\ding.wav"