Hello.
I have a database where an engineer can order a project. I am trying to set it up so the database will automatically send an e-mail notification (sendObject Method) to the assigned party, as well as managers involved, and the requester. I am currently testing it, and am running into an error - "Too few parameters. Expected 1." Any ideas on why I am getting this error?
'***Start Code ***
Private Sub Command58_Click()
On Error GoTo Err_Command58_Click
'Declaration of Variables
Dim email As String
Dim cc As String
Dim origin As String
Dim body As String
Dim dbs As DAO.Database
Dim rs1 As DAO.Recordset
Dim rs2 As DAO.Recordset
'Open and populate the recordset with required data
Set dbs = CurrentDb
Set rs1 = dbs.OpenRecordset("Select * FROM Ref_Employee WHERE Name = " & RequesterName.Value)
Set rs2 = dbs.OpenRecordset("Select * FROM Ref_Employee WHERE Name = " & AssignedTo.Value)
'Gather the information about the e-mail
email = rs2("Email"

If rs1("Job"

= "Product Engineer" And rs1("EmpStatus"

= "Active" Then
cc = "ProductManagerEmail@company.com"
Else
cc = "OtherManagerEmail@company.com"
End If
origin = rs1("Email"
'Set up the body of the e-mail to add all fields
body = OrderDate & Chr(13) & Chr(13)
body = body & "Project: " & ProjectNumber & " - " & ProjectName & Chr(13)
body = body & "Name of Requester: " & RequesterName & Chr(13)
body = body & "Context of Test: " & TestContext & Chr(13) & Chr(13)
body = body & "Description of Work: " & DescriptionOfWork & Chr(13) & Chr(13)
body = body & "Assigned To: " & AssignedTo & Chr(13)
body = body & "Start Date: " & StartDate & Chr(13)
'Send the e-mail to the recipients
DoCmd.SendObject acSendForm, , acFormatTXT, email, cc, , "You have been assigned a project by " & origin & "!", body, True
'Add a new record
DoCmd.GoToRecord , , acNewRec
Exit_Command58_Click:
Exit Sub
Err_Command58_Click:
MsgBox Err.Description
Resume Exit_Command58_Click
End Sub
'***End Code***
Currently, everyone on our network uses Outlook, so I was considering using that. However, if I switch to the Outlook Application method, I would like to send a TASK, not an e-mail. Is there a way to send this as a task, and not as an e-mail?
Thanks in advance for all your help.
Jon