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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|