stop error message

steve111

Registered User.
Local time
Today, 17:49
Joined
Jan 30, 2014
Messages
429
hi

this is the code I use to prepare the invoice for sending

Code:
Private Sub cmdEmail_Click()
  
     Dim strTo As String
    Dim strSubject As String
    Dim strMessageText As String
    
    Me.Dirty = False
    
    strTo = Me.[E-Mail address]
    strSubject = "Invoice Number " & Me.Invoicenumber
    strMessageText = Me.CustomerName & ":" & _
        vbNewLine & vbNewLine & _
        "Your latest invoice is attached." & _
        vbNewLine & vbNewLine & _
        "Customer Accounts Department, Widget Supply Company"
 
    DoCmd.SendObject ObjectType:=acSendReport, _
        ObjectName:="Invoice report", _
        OutputFormat:=acFormatPDF, _
        To:=strTo, _
        Subject:=strSubject, _
        MESSAGETEXT:=strMessageText, _
        EditMessage:=True
     
 End Sub

if the user decides not to sent it I get a message
" the send object was cancelled "
can this code be modified so I don't get that message

thanks
steve
 

Users who are viewing this thread

Back
Top Bottom