A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Email Button



 
 
Thread Tools Display Modes
  #1  
Old July 8th, 2009, 07:32 AM posted to microsoft.public.access
mavis
external usenet poster
 
Posts: 85
Default Email Button

Hi all,

I will like to create a button in my report to allow user to forward the
report as attendment in the email by clicking on the button.

Anyone can advice how can i do that?

Thanks in advance.

  #2  
Old July 8th, 2009, 11:15 AM posted to microsoft.public.access
Wayne-I-M
external usenet poster
 
Posts: 3,674
Default Email Button

Hi Marvis

There are a number of way to do this - this is just one simple method

I assum you have a report called ReportName - of course change the code to
what it really is.

Create a form
On the form put a button (called ButtonName)
Add a text box (called EMailAddressTextBoxName)

Put this code OnClick of the button

Private Sub ButtonName_Click()
Dim intResponse As Integer
intResponse = MsgBox("To send the e mail click YES " & vbCrLf & vbCrLf & _
"To cancel sending click NO", vbYesNo, "Report E Mailer")
If intResponse = vbYes Then
DoCmd.SendObject acReport, "ReportName", "RichTextFormat(*.rtf)", _
Me.EMailAddressTextBoxName, "", "", "Your Report", _
"I have attched the report you wanted", False, ""
ElseIf intResponse = vbNo Then
MsgBox "Report sending cancelled", vbOKOnly, "Report E Mailer"
End If
End Sub


Type in an e mail addess then click the button

Of course you can select the e mail address from a combo box - list, etc.
You can improve this by checking that the e mail address is there (is not
null) etc. But the above should start you off

hope this helps

--
Wayne
Manchester, England.



"Mavis" wrote:

Hi all,

I will like to create a button in my report to allow user to forward the
report as attendment in the email by clicking on the button.

Anyone can advice how can i do that?

Thanks in advance.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:21 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.