Button to email report contents formatted in letter?

Charlie2

Registered User.
Local time
Today, 14:33
Joined
Mar 28, 2002
Messages
79
Hi,
I have created an application in Access 2002, in the application I have several forms that display clients data etc.

Also I have a button that displays a report that is linked to the ClientID field
which is formatted into a letter, either complaining about late payment or requesting the client to attend an interview.

I also have a button to print the formatted report, what I would like to do is have a button that will email the report(letter) to the client or whomever on clicking of the button.

Is this possible? If so how is this done?

Cheers Charlie
 
Charlie2 said:
Hi,
I have created an application in Access 2002, in the application I have several forms that display clients data etc.

Also I have a button that displays a report that is linked to the ClientID field
which is formatted into a letter, either complaining about late payment or requesting the client to attend an interview.

I also have a button to print the formatted report, what I would like to do is have a button that will email the report(letter) to the client or whomever on clicking of the button.

Is this possible? If so how is this done?

Cheers Charlie

Charlie

There are a number of different ways to achieve what you want. I have just done a forum search and there are lots of posts on this subject and lots of code examples.

Do a forum search on 'email report' and look for the best solution for you.
 
Thanks

Hi,
I looked around and found a little code that almost does what I want.


Code:
Private Sub Command47_Click()
On Error GoTo Err_Command47_Click

    Dim stDocName As String

    stDocName = "tblChemistClientPersonal"
    DoCmd.SendObject acReport, stDocName, "RichTextFormat(*.rtf)", EMail, , , SubjectLine, _
"Please see attached document.", False



Exit_Command47_Click:
    Exit Sub

Err_Command47_Click:
    MsgBox Err.Description
    Resume Exit_Command47_Click
    
End Sub

The problem is I would like the code to get the email address from the form which is linked to the client.


Cheers again Charlie
 
Charlie2 said:
Hi,
I looked around and found a little code that almost does what I want.


The problem is I would like the code to get the email address from the form which is linked to the client.


Cheers again Charlie

I think the line you need is:

Command47.HyperlinkAddress = "mailto: " & Me!

Where 'email' is the name of the text control on your form that holds the e-mail address you want to send to.
 
Thanks again

The message tries to send using the line you suggested but i get an error stating that the "message has an unknown recipient and was not sent".

Code:
Command47.HyperlinkAddress = "mailto: " & Me![Text45]


Charlie
 

Users who are viewing this thread

Back
Top Bottom