display 'ok' message when automatic email sent (1 Viewer)

philbennison

Registered User.
Local time
Today, 02:01
Joined
Nov 10, 2004
Messages
49
Hi all.
I have a simple program that will email a report to a specific person when a button is pressed. Is there a way to display a message box with text on it (and an 'ok' button to clear the box) when the email is sent. i am sure it must be an easy command.

My code is below

Private Sub command_Click()
On Error GoTo Err_command_Click

Dim strEmail As String
Dim strDoc As String


strEmail = Forms!main_form!email
strDoc = "document name"
strSubject = "Urgent report from ??"
strMessage = "Please find attached urgent report from ???"

DoCmd.SendObject acSendReport, strDoc, acFormatRTF, strEmail, , , strSubject, strMessage, False

Exit_command_Click:
Exit Sub

Err_command_Click:
MsgBox Err.Description
Resume Exit_command_Click

End Sub


Thanks in advance

Phil
 

ghudson

Registered User.
Local time
Yesterday, 21:01
Joined
Jun 8, 2002
Messages
6,195
Code:
MsgBox "Email sent.", vbInformation, "Success"
 

Users who are viewing this thread

Top Bottom