If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
SendObject with multiple strTo entries
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, , , ,mi.......@e ", , , "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]" & ,mi.... ]" 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 & " and i have tried strTo = Me.Analyst_Email & ,do.....@egseg " 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 |
#2
|
|||
|
|||
SendObject with multiple strTo entries
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: "JNariss" wrote in message ups.com... 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, , , ,mi.......@e ", , , "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]" & ,mi.... ,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 & " and i have tried strTo = Me.Analyst_Email & ,do.....@egseg " 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 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiple entries in "To" selection list | Susie Harris | General Discussion | 1 | September 9th, 2005 07:26 PM |
how to count unique entries with multiple condition | Michael | Worksheet Functions | 6 | June 29th, 2005 12:38 PM |
How do I Select Multiple entries from Valid list for a Cell | WIDBIS | General Discussion | 1 | June 29th, 2005 12:53 AM |
Multiple entries | TJ | General Discussion | 2 | February 18th, 2005 04:29 PM |
Multiple Many-To-Many Tables | Tom | Database Design | 7 | May 15th, 2004 03:47 AM |