473,396 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

VBA to send email from Access, adding report to body of email

Access 2010 - add report to body of an email

good morning,

i have VBA code to create an email and attach an excel file,

what i would like is code to add a report called REPORTMISSINGDATES to the body of the email,

this is the code i have so far, which works and adds everythng i wqant except the main body of the email

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command31_Click()
  2.  On Error GoTo Command31_Click_Err
  3.  
  4.  
  5. Dim Email As String
  6.  Dim name As Variant
  7.  Dim EMPloy As Variant
  8.  Dim month As Variant
  9.  
  10. month = MonthName([Forms]![STAFFATTENDANCEMenu]![StaffMonth])
  11.  EMPloy = Forms!staffattendancezone!Staff
  12.  name = DLookup("[STAFFNAME]", "[QRYSTAFFNAME]", "[ASA] = Forms!staffattendancezone!Staff")
  13.  
  14. Email = (Forms!STAFFATTENDANCEAdjust!Email)
  15.      DoCmd.SendObject acQuery, "STAFFATTENDANCEZONECheckEmployee", "ExcelWorkbook(*.xlsx)", [email], "", "", "" & "Attendance Errors", "THIS IS WHERE I WANT THE REPORT TO GO" _
  16.  
  17. End Sub
Feb 25 '13 #1
1 2283
zmbd
5,501 Expert Mod 4TB
Please go to the bottom of this page.
Click on the Microsoft Access/VBA Insights Sitemap
Scroll down to article number 159
This contains the basics for Outlook automation.

Please keep in the following in mind:
Out right requests for full code are against site policy.
Bytes is not a code nor homework service. Please read the FAQ and posting guidelines before re-posting your question.
>> Before Posting (VBA or SQL) Code.
>> How to ask "good" questions -- READ BEFORE SUBMITTING A QUESTION!.
>> POSTING_GUIDELINES: Please Read Carefully Before Posting to a Forum.
Feb 25 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Nathaniel Maier | last post by:
Hi. How can I send form results to an email address based on what the user selects? e.g. not to the same address all the time, and not to all addresses, but to the one that the user selects. How...
2
by: CSDunn | last post by:
Hello, I have an Access 2003 report that opens in print preview and then maximizes upon clicking a button from a form. The OnClick event of the button fires a macro to open the report. How can...
2
by: Will | last post by:
I am trying to send a report by email using DoCmd.SendObject acSendReport. When I send the report, it sends the report with all the records whereas I only want the report to show one record. I...
7
by: Mega1 | last post by:
is this possable to send more than 1 report in one email
1
by: Mike John | last post by:
I want to send the page in the body of the email , just like the functionality of the send page in the browser explorer . I have tried the following systax <html> <body> <input type ="Button"...
3
by: Luiz Vianna | last post by:
Guys, I have a Windows 2003 running Exchange 2003. On this machine I'm trying to run an ASP.NET webform to send an e-mail. The codebehing my ASPX is like this: Dim NewMail As New...
3
by: touf | last post by:
hi, 1- I've a report (Crystal reports) created from a vb Form (crystalReportsViewer) How can I send it via email , In crystal report there is the possibility to export, but I didn't find a way to...
1
by: mrajanikrishna | last post by:
Hello Friends, I am generating two reports but two files. First report is Shipment Booking Form. After generating this form, I want to send to the cargo management by email. As far everything...
1
by: sxwend | last post by:
I am trying to use the following post results (http://www.thescripts.com/forum/thread189759.html) and add another requirement. I need to send the results to just the email addresses that the query...
6
by: plaguna | last post by:
How can I sent a Report via Email with a *.mdb output format. Access gives me the option to send an email only as HTML (*.htm,*.Html), Rich Tex Format (*.rtf), Snapshop Format (*.snp), and Text...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.