Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Chr 9 is throwing a ERr 13

1 view
Skip to first unread message

EAB1977

unread,
Oct 5, 2010, 8:28:34 AM10/5/10
to
All,

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

EAB1977

unread,
Oct 5, 2010, 2:50:12 PM10/5/10
to
Figured it out...I wasn't converting my request ID as string.
0 new messages