Public Sub Auto_RepCompEmail()
On Error GoTo Err_Auto_ITEmail
Dim mycount As Integer
Dim MyEmail As String
Dim MyNote1 As String
Dim SendTo As String
Dim MyDb As Object
Dim MyRs As Object
SendTo = "vicki....@us.ngrid.com"
Me.Refresh
MyNote1 = "Vicki" & vbCrLf & vbCrLf & "Attached is a copy of the NERC
Reportable Incident." & vbCrLf & vbCrLf & vbCrLf & "Regards"
'Send the data and a reminder for the selected Incident in an
'email to the person the projects was assigned to
DoCmd.SendObject acReport, "Rpt_NERCReportableIncidReport_Email2",
"RichTextFormat(*.rtf)", SendTo, "", "", "NERC Reportable Incident For
Case Number " & TxtCaseNumber, MyNote1, True, ""
Me![TxtDateReported] = Now()
Me.Requery
Set MyRs = Me.RecordsetClone
If MyRs.RecordCount = 0 Then
DoCmd.Close acForm, "Frm_NERC_ReportableIncidentsList"
End If
Exit_Auto_ITEmail:
Exit Sub
Err_Auto_ITEmail:
If Err.Number = 2293 Then
MsgBox MyMsg10A & Chr(13) & MyMsg10B, vbExclamation,
Me.Caption
Exit Sub
ElseIf Err.Number = 2296 Then
MsgBox "Operation Cancelled", vbInformation, Me.Caption
Exit Sub
ElseIf Err.Number = -2147352567 Then
MsgBox "All required fields were not entered"
Exit Sub
Else
MsgBox Err.Number & Err.Description, vbInformation, Me.Caption
End If
Resume Exit_Auto_ITEmail
End Sub
Does anyone have any idea why this is happening?
Thanks...
Earl
I don't know if this makes a difference. This is from A97 help
outputformat One of the following intrinsic constants:
acFormatHTML
acFormatRTF
acFormatTXT
acFormatXLS
So instead of "RichTextFormat(*.rtf)" maybe acFormatRTF?
Don't know if it makes a diff, but use acSendReport.
I guess the real question is...what line does it blow up on? I'm
assuming the SendObject line but is it the culprit?
Do your users have full versions of Access or do they run from a MDE?
If full, and the SendObject is the culprit, they could attempt to send a
test email from the debug window. If an MDE, then maybe give them a
junk mde with the ability to send an email that you put behind a command
button with explicit stuff. Supply a report called Junk. Ex:
DoCmd.SendObject acSendReport, "Junk", , "j...@test.com", "", "",
"Test Subject", "TestBody", True