I need to send cc's to multiple people on the following line.
strMgrEmail = rs2.MgrEmail
In addition to rs2.MgrEmail, I also want to cc rs2.AdmMgr and rs2.WsMgr
but I'm not sure how to modify the strMgrEmail = rs2.MgrEmail line
Any help will be greatly appreciated.
jr
Private Sub cmdSendRem1_Click()
Dim dbs As Database
Dim rs1 As Recordset
' Dim rs2 As Recordset
Dim RecCnt As Integer
Set dbs = CurrentDb()
Set rs1 = dbs.OpenRecordset("LogRem")
Set rs2 = dbs.OpenRecordset("qryTmpRem1")
RecCnt = 0
' On Error GoTo Dberror
rs2.MoveFirst
Do Until rs2.EOF
If rs2.Notify <> 0 Then
With rs1
.AddNew
!Week = rs2.Week
!LogonID = rs2.LogonID
!MessSent = Me.txtMessDate2
!MessNbr = rs2.MessNbr
!Period = rs2.Period
!Reason = rs2.Reason
!Associate = rs2.Associate
!AdmMgr = rs2.AdmMgr
!WsMgr = rs2.WsMgr
!SchHrs = rs2.SchHrs
!ActHrs = rs2.ActHrs
!AdmLvl = rs2.AdmLvl
!Notify = rs2.Notify
!NOTcd = rs2.NOTcd
.Update
.Clone
End With
Dim strMess As String
strAssEmail = rs2.eMail
strMgrEmail = rs2.MgrEmail
strBccEmail = "Constant1@aol.com"
strGreeting = rs2.Greeting
strMessNbr = rs2.MessNbr
strPeriod = rs2.Period
strAssociate = rs2.Associate
strWsEmail = rs2.WsEmail
strSchHrs = rs2.SchHrs
strActHrs = rs2.ActHrs
strSubj = "RMP" & strMessNbr & " Reminder to: " & strGreeting
strMess = "Associate Name: " & [strGreeting] & Chr$(13) & Chr$(13) _
& "Reporting Period: " & [strPeriod] & Chr$(13) & Chr$(13) _
& "Scheduled Hours: " & [strSchHrs] & Chr$(13) & Chr$(13) _
& "Hours Recorded: " & [strActHrs] & Chr$(13) & Chr$(13) _
& Chr$(13) & Chr$(13) _
& rs2.L01 & Chr$(13) _
& rs2.L02 & Chr$(13) _
& rs2.L03
DoCmd.SendObject , , _
acFormatRTF, _
strAssEmail, _
strMgrEmail, _
strBccEmail & ";Constant2@aol.com", _
strSubj, _
strMess, False, False
RecCnt = RecCnt + 1
End If
rs2.MoveNext
Loop
rs2.Close
Requery
MsgBox RecCnt & " First Reminders Sent. ", vbInformation
' DoCmd.Close
' Forms.frmMainMenu.Visible = True
CurrentDb.Execute "DELETE * FROM tmpRem1;"
Requery
Exit Sub
Dberror:
If Err = 3021 Then
MsgBox "There are no messages to send. "
DoCmd.Close
Forms.frmMainMenu.Visible = True
Else
MsgBox "There was an error adding the record. Error# " _
& Err.Number & ", " & Err.Description
End If
End Sub