Code:
Private Sub cmdEmail_Click()
On Error GoTo Err_Handler
Dim strTo As String
Dim strSubject As String
Dim strMessageText As String
If IsNull(Me.[E-Mail address]) Then
MsgBox "No email address in customer form"
Exit Sub
Else
Me.Dirty = False
Me.addressno = InputBox("Please provide address line number")
strTo = Me.[E-Mail address]
strSubject = "Invoice Number " & Me.[Invoice].[Form]![InvoiceNo]
strMessageText = Me.[Firstname] & "," & _
vbNewLine & vbNewLine & _
"Your latest invoice is attached." & _
vbNewLine & vbNewLine & _
""
DoCmd.SendObject ObjectType:=acSendReport, _
ObjectName:="Invoice report", _
OutputFormat:=acFormatPDF, _
TO:=strTo, _
Subject:=strSubject, _
messageText:=strMessageText, _
EditMessage:=True
Exit_Here:
End If
Exit Sub
Err_Handler:
MsgBox Err.Description
Resume Exit_Here
End Sub
this is the code i use to send an invoice to the customer , if possible i would like it to tick the "sent invoice" tick box. within this code . the form is called invoices
thanks for you help