Private Sub Command343_Click()
On Error GoTo Error_Handle
Dim strBody As String
Me.usercompany = DLookup("[companyname]", "tblusersettings")
'Email Client'
strBody = "Dear valued customer," & vbCrLf & vbCrLf & _
"Below you will find your invoice, credit memo, sales receipt, or statment. If you need to remit payment, please do so at your earliest convenience." & vbCrLf & vbCrLf & _
"Thank you for your business- we appreciate it very much." & vbCrLf & vbCrLf & _
"Sincerely," & vbCrLf & _
Me.usercompany
DoCmd.SendObject acSendReport, invoiceLH, acFormatPDF, _
"" & Me.clientemail, _
, _
, _
"Notification from " & Me.usercompany, _
"" & strBody, _
True
Error_Handle:
If Err.Number = 2501 Then
MsgBox "The email was canceled and has not been sent", , "Email Invoice"
Exit Sub
Exit_Error_Handle:
End Sub
|