Results 1 to 5 of 5
  1. #1
    degras is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    72

    How to send filtered report via email


    I have a report that I currently open via a button that runs the following code:

    DoCmd.OpenReport "MultiInvoice", acViewPreview, , "InvoiceNo = '" & Me.InvoiceNo & "'", , "NoGroup"

    I would like a function for emailing this report. I am aware of the "DoCmd.SendObject" command, however there is no "where clause" in this command. How do I get around this limitation?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    A couple of ways, simplest for you probably adding the SendObject line right after the OpenReport line. Though SendObject doesn't have the wherecondition argument, if the report is already open it should send the filtered report.

    You can also filter from within the report:

    http://www.granite.ab.ca/access/emai...recipients.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    degras is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    72
    OK, thanks.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help. Did that work for you?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    degras is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    72
    Quote Originally Posted by pbaldy View Post
    Happy to help. Did that work for you?
    Yes, I made an extra function to output the report to PDF. I told the users they could email the report via the main menu.

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

Similar Threads

  1. How can I send an email from access???
    By Asma in forum Programming
    Replies: 2
    Last Post: 12-07-2011, 07:49 AM
  2. send email to email addresses in database?
    By cnstarz in forum Access
    Replies: 5
    Last Post: 03-02-2011, 09:46 PM
  3. send email reminder
    By azaz in forum Forms
    Replies: 1
    Last Post: 12-26-2010, 08:35 AM
  4. Replies: 9
    Last Post: 10-09-2009, 08:15 AM
  5. Replies: 1
    Last Post: 05-01-2009, 07:33 AM

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