SendObject with multiple strTo entries

J

JNariss

Hello,

I have nearly become an expert using the SendObject. However I have now
run into a slight problem. I have this one form that did a fantasic job
of emailing to a group of 4 people. Not 4 ordinary people but 4
"Managers". Well, now it seems that the "Analysts" would like to
receive a notification as well.

So I used to have my send obect set up with:

DoCmd.SendObject acSendNoObject, , ,
"(e-mail address removed),[email protected],[email protected],[email protected]",
, , "Move To Production1", strMessage, No, False


This is not going to work anymore and I can't just throw in the
analyst's name b/c there are a ton of analysts and each time this form
is used it could be a different analyst that it will be sent to.

So I've been using the Dim strTo As String, strTo = syntax to try to
accomplish grabbing the Analyst Email from that field on the form as
well as still emailing to the group of 4 managers. The only problem now
is...............it's not working.

Here is the code I have tried:

Private Sub cmdSubmit_Click()

Dim strRequest_ID As String
Dim strTo As String
Dim strHeader As String
Dim strMessage As String
Dim strAuthorized_By As String

strRequest_ID = Me.Request_Request_ID
strTo = "[Me.Analyst_Email]" &
"[[email protected],[email protected],[email protected],[email protected]]"
strHeader = "Request moved into production"
strMessage = "A request has been officially moved into production.
Details for this move are below." _
& "If this move was incorrect please contact the listed Authorizer
below:" & Chr$(13) & Chr$(13) & _
"Request_ID: " & strRequest_ID & Chr$(13) & Chr$(13) & _
"Authorized By: " & strAuthorized_By & Chr$(13) & Chr$(13) & _
"Please do not respond to this automated email."

DoCmd.SendObject acSendNoObject, , , strTo, , , strHeader,
strMessage, No, False

DoCmd.Close acForm, "frmMoveToProd1"

MsgBox "You have submitted this request into production" &
Chr$(13) & Chr$(13) & _
"and sent notification to management and the assigned
analyst.", vbOKOnly, _
"Move To Production Successful!"

End Sub


I have tried numerous things with the line "strTo = " such as taking
out the [ ] and taking out the " " and leaving it as one like
"Me.Analyst_Email & (e-mail address removed),[email protected]" and i have tried
strTo = Me.Analyst_Email &
"(e-mail address removed),[email protected],[email protected],[email protected]"
but neither of them seem to work.

Is this even possible??????? And if not how can I make it happen or do
something similar to this???

I appreciate it,
Justine
 
A

Allan Murphy

I have a table that store email addresses in the format
emailaddress1;emailaddress2; etc in a field email_clients
I then use code to lookup the email_clients

part of the code as follows

Dim temp_email_ss As String
Dim email_ss As String
temp_email_ss = DLookup("[email_clients]", "[tbl_port]", "id=1")
email_ss = temp_email_ss

DoCmd.SendObject acReport, "rpt_pax_loadings_main_port",
"SnapshotFormat(*.snp)", email_ss, "", "", "Loadings Report from " &
Me!beginning_date & " to " & Me!finish_date, "", True, ""

This sends a loadings report to my email clients, the & Me!beginning_date &
" to " & Me!finish_date,puts the start and finish date of the period in the
subject line of the report.

You could create a group for analysts and managers and store the email
addresses as analysts;managers or include all the users in the field and
update as required.

--
Allan Murphy
Email: (e-mail address removed)

JNariss said:
Hello,

I have nearly become an expert using the SendObject. However I have now
run into a slight problem. I have this one form that did a fantasic job
of emailing to a group of 4 people. Not 4 ordinary people but 4
"Managers". Well, now it seems that the "Analysts" would like to
receive a notification as well.

So I used to have my send obect set up with:

DoCmd.SendObject acSendNoObject, , ,
"(e-mail address removed),[email protected],[email protected],[email protected]",
, , "Move To Production1", strMessage, No, False


This is not going to work anymore and I can't just throw in the
analyst's name b/c there are a ton of analysts and each time this form
is used it could be a different analyst that it will be sent to.

So I've been using the Dim strTo As String, strTo = syntax to try to
accomplish grabbing the Analyst Email from that field on the form as
well as still emailing to the group of 4 managers. The only problem now
is...............it's not working.

Here is the code I have tried:

Private Sub cmdSubmit_Click()

Dim strRequest_ID As String
Dim strTo As String
Dim strHeader As String
Dim strMessage As String
Dim strAuthorized_By As String

strRequest_ID = Me.Request_Request_ID
strTo = "[Me.Analyst_Email]" &
"[[email protected],[email protected],[email protected],do......@eg
seg.com]"
strHeader = "Request moved into production"
strMessage = "A request has been officially moved into production.
Details for this move are below." _
& "If this move was incorrect please contact the listed Authorizer
below:" & Chr$(13) & Chr$(13) & _
"Request_ID: " & strRequest_ID & Chr$(13) & Chr$(13) & _
"Authorized By: " & strAuthorized_By & Chr$(13) & Chr$(13) & _
"Please do not respond to this automated email."

DoCmd.SendObject acSendNoObject, , , strTo, , , strHeader,
strMessage, No, False

DoCmd.Close acForm, "frmMoveToProd1"

MsgBox "You have submitted this request into production" &
Chr$(13) & Chr$(13) & _
"and sent notification to management and the assigned
analyst.", vbOKOnly, _
"Move To Production Successful!"

End Sub


I have tried numerous things with the line "strTo = " such as taking
out the [ ] and taking out the " " and leaving it as one like
"Me.Analyst_Email & (e-mail address removed),[email protected]" and i have tried
strTo = Me.Analyst_Email &
"(e-mail address removed),[email protected],[email protected],[email protected]"
but neither of them seem to work.

Is this even possible??????? And if not how can I make it happen or do
something similar to this???

I appreciate it,
Justine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top