Results 1 to 3 of 3
  1. #1
    Robert2150 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2013
    Location
    Sparks, Nv
    Posts
    102

    Emailing report in access

    I am currently working with an Access 2010 database. I have incorporated buttons to print specific reports related to a specific record on a table. Now I would like to set a command button to send that report by email (Using Outlook). I used the MACRO builder to do this, however when the Email is developed in Outlook all pages of the report are attached. In my print reports button I have the following code to limit which record report to print.

    strWhere = "[Property Number] = " & Me.[Property Number]

    How can I input this code into the Email Macro?, or is there another approach I could use?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I don't know how you are sending your emails but this is example code of mine that I use to save a report with specific criteria. The key is opening the report with a where clause. In this case I use a variant but you can place your string there. After it is open, you need to slelect it with Docmd.SelectObject. Now you are ready to Docmd.OutputTo.

    Things might be a little different for Access 2010 and I don't know exactly how you are sending your emails but I believe the info you need is contained below in this example of how to save a text file to your hard drive.

    DoCmd.OpenReport stDocName, acViewPreview, , varWhere, acHidden
    DoCmd.SelectObject acReport, stDocName, False
    DoCmd.OutputTo acOutputReport, stDocName, acFormatTXT, strDirectory
    DoCmd.Close acReport, stDocName

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    You have to open the report filtered to that criteria then send the open report.

    Are you using SendObject method?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Emailing monthly report through access 2007
    By andrewmo in forum Reports
    Replies: 1
    Last Post: 05-16-2012, 02:41 PM
  2. Replies: 3
    Last Post: 12-05-2011, 02:19 PM
  3. Emailing Personalized Report
    By rgrwatson85 in forum Reports
    Replies: 3
    Last Post: 10-20-2011, 10:21 AM
  4. Emailing Report with Attachments
    By Rookie in forum Reports
    Replies: 1
    Last Post: 08-19-2011, 06:52 PM
  5. Emailing a report
    By prv in forum Access
    Replies: 1
    Last Post: 12-20-2010, 04:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums