Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2005
    Posts
    1

    Email a report of the current record.

    I am in dire need of assistance! I need to email a report, but isolate the one record. Similar to having a form open, with multiple records then printing only 1 record. I need to do this, but with email. Below is the code to print a report of the current record, I need to email a report of the current record. Any ideas? Thanks in advance!

    Dim stDocName As String


    Dim strwhere As String

    stDocName = "rptRef"
    strwhere = "[PtNum]=" & Me!PtNum
    DoCmd.OpenReport stDocName, acNormal, , strwhere

    I don't know how to email the current record with the docmd.sendobject function. Anyone know?

  2. #2
    jya is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2007
    Location
    Chicagoland
    Posts
    109
    I would like to know the answer to this one as well. I've tried to do something similar.

    To sort of get around this, I created a duplicate query but with a prompt (ie. [Enter the record #]), and used that as my control source for my report. This doesn't automatically give you the current record, but it gives the opportunity to specify the record.

    Sorry I can't be of more help.

  3. #3
    craigperkins is offline Novice
    Windows 11 Access 2003
    Join Date
    Aug 2023
    Posts
    5
    I too am looking to automate this, I have done the same workaround as you with an enter record query.

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    Quote Originally Posted by craigperkins View Post
    I too am looking to automate this, I have done the same workaround as you with an enter record query.
    This is a 15 year old thread?
    Stick to your own thread and answer the questions asked of you.

    This is a really simple task, made hard by not having the correct information.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    Wow talk about a thread resurrection - this is a 2007 thread - its 16 years old!

    The normal route would be to build a form that would let you select the record you wanted, then use that to filter the report.
    You would normally the save the report as a pdf and then attach it to the email, or use the send object to do that for you (less flexible than automating Outlook but easier)

    There must be 100's of examples of that on here.
    Here's one: https://www.accessforums.net/showthr...t=print+report
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

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

Similar Threads

  1. Email Report for each Vendor
    By dennisg in forum Reports
    Replies: 0
    Last Post: 09-29-2008, 02:43 PM
  2. Replies: 3
    Last Post: 02-13-2008, 09:55 AM
  3. Another email report question ...
    By valkyry in forum Reports
    Replies: 0
    Last Post: 05-23-2007, 11:42 PM
  4. Mailmerge Current Record...
    By oakleyp2 in forum Programming
    Replies: 0
    Last Post: 02-22-2006, 08:08 AM
  5. How to output only current record in query
    By mslieder in forum Access
    Replies: 0
    Last Post: 01-20-2006, 05:48 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