View Full Version : Email a Report Using a Command Button


aziz rasul
11-22-2000, 08:22 AM
I'm not familiar with VBA. Hence any code must be clear.
I have a form with a combo box and a command button. The combo box holds a list of email addresses. What code do I need behind the command button such that it automatically sends a report(in rtf format) to the chosen email address currently showing in the combo box. In other words, pressing the command button automatically places the email address in the appropriate place in MS Outlook & the attachment. Many thanks in advance.

Talismanic
11-22-2000, 08:45 AM
This works, all you need to do is replace the Me.Email with Me.YourControl that holds the email address. You can also remove the optional Subject and Message to leave them blank. Just leave blank commas like , , ,.

DoCmd.SendObject acReport, "ReportName", "RichTextFormat(*.rtf)", _
Me.Email, , , "OptionalSubject", "OptionalMessage", False

If you want to be able to edit the message before it is sent change the false to true. Any other question just post back!

aziz rasul
11-23-2000, 03:54 AM
That really helped. Many Thanks.