I have a module set up to run that will inform users if outstanding
follow-ups. I am trying to place some code in my email that tabs over
(Chr(9)). When my code runs, I get a Error 13 that comes up. I can't
think of why I'd be getting this error. This code isn't totally done,
but it's pretty much there.
Function SendFollowUpEmail()
Dim rst2 As DAO.Recordset, strSQL As String
Dim strBody As String, eml As New clsEmail
'MsgBox "Under Construction"
'Exit Function
Set db = CurrentDb
Set rst = db.OpenRecordset("SELECT QISEmpID FROM tblQIS WHERE
QISInactive = False")
rst.MoveFirst
Do Until rst.EOF
strSQL = "SELECT tblLog.RequestID, tblProgram.Program,
tblIssue.IssueText FROM tblQIS" _
& " INNER JOIN (tblProgram INNER JOIN (tblIssue INNER JOIN
tblLog ON tblIssue.IssueID = tblLog.IssueID)" _
& " ON tblProgram.ID = tblIssue.ProgramID) ON tblQIS.QISID =
tblLog.QISID WHERE tblQIS.QISEmpID = '" _
& rst!QISEmpID & "' AND tblLog.FollowupText Is Null AND
tblLog.Followup <> 0;"
MsgBox strSQL
Set rst2 = db.OpenRecordset(strSQL)
Do Until rst2.EOF
strBody = strBody + rst2!RequestID + Chr(9) 'Tab <--- code
errors here
strBody = strBody + rst2!Program + Chr(9) 'Tab
strBody = strBody + rst2!IssueText + Chr(13) 'Carriage Return
rst2.MoveNext
Loop
'Start the email process
eml.CurrentUser = "D35058"
eml.AddRecipient rst!QISEmpID & "@dart.biz"
eml.AddEmployeeRecipient Right(rst!QISEmpID, 5)
eml.SenderEmail = "D35...@dart.biz"
eml.Subject = "Outstanding Follow-Ups"
eml.Body = strBody
If (eml.Send) Then
MsgBox "Email sent OK"
Else
MsgBox "Email FAILED"
End If
Set rst2 = Nothing
Loop
Set rst = Nothing
Set db = Nothing
End Function