A family of Microsoft relational database management systems designed for ease of use.
Private Sub cmd_Email_Click()
Dim strObjName As String
Dim strCriteria As String
On Error GoTo Err_Handler
'save it
If Me.Dirty = True Then Me.Dirty = False
strObjName = "rpt_Current_Quote_Email"
strCriteria = "objID = " & Me.txt_QuoteNo
'Send the Quote as PDF Attachment to e'mail
'DoCmd.OpenReport strObjName, acViewPreview, , strCriteria
DoCmd.SendObject acSendReport, strObjName, acFormatPDF, , , , _
"Your Quotation: " & Me.txt_JobTitle, vbCrLf & _
"Dear " & Me.txt_Contact & "," & vbCrLf & _
"Please find attached our Quotation " _
& vbCrLf & "No: " & Me.txt_QuoteNo _
& vbCrLf & vbCrLf & _
"For: " & Me.txt_JobTitle _
& vbCrLf & vbCrLf, -1
Clean_Exit:
Exit Sub
Err_Handler:
Beep
Select Case Err.Number
Case 2501 'user cancelled
Case Else
MsgBox Err.Number & " : " & Err.Description, vbCritical, "Form_frm_Quotes.cmd_Email_Click" & ":"
End Select
Err.Clear
Resume Clean_Exit
End Sub
As i said, It's very old code.
Still works though - Solved the crashing by creating a new Outlook profile for the user. - Go Figure.