I have a few different on-click events that send a task to a specific address, based on MSDN help:
_______________________________________
Private Sub Ass2_Click()
On Error GoTo Err_Ass2_Click
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olTaskItem)
myItem.Assign
Set myDelegate = myItem.Recipients.Add("Marty")
myItem.Subject = "CAPA #" & CAPA_No & " has been assigned to you" & _
" This CAPA is due on " & [Section_III_Due_Date]
myItem.ReminderSet = True
myItem.DueDate = [Section_III_Due_Date]
myItem.Send
[Completed On Time?] = "Pending"
Exit_Ass2_Click:
Exit Sub
Err_Ass2_Click:
MsgBox Err.Description
Resume Exit_Ass2_Click
End Sub
____________________________________
I need to know how to add a variable recipient based on a field in my form. User selects recipient from drop down list in a separate field (Assigned To) and I need to get that result into this code to send the task request to that recipient. I've tried changing code a bunch of different ways with no luck. This is my 1st try at programming btw- so I'm totally lost to begin with
...
_______________________________________
Private Sub Ass2_Click()
On Error GoTo Err_Ass2_Click
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olTaskItem)
myItem.Assign
Set myDelegate = myItem.Recipients.Add("Marty")
myItem.Subject = "CAPA #" & CAPA_No & " has been assigned to you" & _
" This CAPA is due on " & [Section_III_Due_Date]
myItem.ReminderSet = True
myItem.DueDate = [Section_III_Due_Date]
myItem.Send
[Completed On Time?] = "Pending"
Exit_Ass2_Click:
Exit Sub
Err_Ass2_Click:
MsgBox Err.Description
Resume Exit_Ass2_Click
End Sub
____________________________________
I need to know how to add a variable recipient based on a field in my form. User selects recipient from drop down list in a separate field (Assigned To) and I need to get that result into this code to send the task request to that recipient. I've tried changing code a bunch of different ways with no luck. This is my 1st try at programming btw- so I'm totally lost to begin with