Results 1 to 2 of 2
2004-07-28, 06:22 #1
- Join Date
- Aug 2001
- Cape Town, South Africa, South Africa
- Thanked 0 Times in 0 Posts
Email to more than 1 email address (Access 2000)
I'm using the following code to email to persons. I have a table tblAllCalls>R30_DivList with the DivName and Email. I would like to include more than one recipients in the email field
Set DB = CurrentDb
Set rs = DB.OpenRecordset("tblAllCalls>R30_DivList", dbOpenDynaset)
Set DivisionName = rs![DivName]
Set DivEmail = rs![Email]
strEmailHeader = "Calls"
strEmailBody = "This spreadsheet"
Do While rs.EOF = False
strTblEmailed = "tblAllCalls>R30"
DoCmd.OpenTable "tblAllCalls>R30", acNormal, acReadOnly
DoCmd.SelectObject acTable, "tblAllCalls>R30", False
DoCmd.ApplyFilter "", "[tblAllCalls>R30]![DivName]=" & Chr(34) & DivisionName & Chr(34)
DoCmd.SendObject acTable, strTblEmailed, "MicrosoftExcelBiff8(*.xls)", DivEmail, "", "", strEmailHeader, strEmailBody, False, ""
DoCmd.Close acTable, "tblAllCalls>R30"
Thanks for any ideas
2004-07-28, 07:08 #2
- Join Date
- Mar 2002
- Thanked 29 Times in 29 Posts
Re: Email to more than 1 email address (Access 2000)
From the online help for the "To" argument:
Separate the recipient names you specify in this argument and in the cc and bcc arguments with a semicolon ([img]/forums/images/smilies/wink.gif[/img] or with the list separator set on the Number tab of the Regional Settings Properties dialog box in Windows Control Panel.
And the example from the online help:
DoCmd.SendObject acSendTable, "Employees", acFormatXLS, _
"Nancy Davolio; Andrew Fuller", "Joan Weber", , _
"Current Spreadsheet of Employees", , False
So you can put more than one recipient in the Email field, separated by semicolons, or you must have another way to retrieve the recipients for a specific record.