Multiple fields in the CC argument

W

wkaupert

Below is the code I am using. It works but I need to add stcc2 to the CC
column. I tried the semicolon but that does not work. I'm not proficient in
code but understand it enough to follow you if you have a suggestion. Thanks
in advance.

Private Sub Command14_Click()
On Error GoTo Err_Command14_Click

Dim stTo As String
Dim stcc As String
Dim stcc2 As String
Dim stSubject As String
Dim stText As String
Dim errLoop As Error

stSubject = "Urgent: Information Regarding Past Due Premium"
stText = "Please review the attached file as it contains details
regarding policies that have not been paid in a timely manner."

Recordset.MoveFirst

Do Until Recordset.EOF

Select Case Me!DeliveryMethod
Case "Y"
stTo = Me.Email1
stcc = Me.Email2
stcc2 = Me.Email3
DoCmd.SendObject acSendReport, "PastDuePremiumNotification",
acFormatRTF, stTo, stcc, , stSubject, stText, 0
End Select

Recordset.MoveNext

Loop

Exit Sub

Exit_Command14_Click:
Exit Sub

Err_Command14_Click:
MsgBox Err.Description
Resume Exit_Command14_Click
End Sub
 
D

Douglas J. Steele

Try:

DoCmd.SendObject acSendReport, "PastDuePremiumNotification", acFormatRTF,
stTo, stcc & ";" & stcc2, , stSubject, stText, 0
 
D

Dale Fye

try:

stcc & ";" & stcc2

Or better yet, instead of:

stcc = Me.Email2
stcc2 = Me.Email3

Try:

stcc = me.email2
if len(me.email3 & "") > 0 then stcc = stcc & ";" & me.email3

Then just leave the code in your SendObject method the way it is.
 

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