Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2014
    Posts
    5

    Email a single record report

    Hi all



    I have a database where I am trying to send an individual record via email, but the report shows all entries, here is the code I have so far, does anyone know where I am going wrong?

    thanks

    Private Sub Command60_Click()

    If Me.Dirty Then Me.Dirty = False 'Save first.
    If Me.NewRecord Then
    MsgBox "Select a record to email."
    ElseIf IsNull(Me.EmailAddr) Then
    MsgBox "No email address to send to"
    Else
    On Error GoTo Err_Command60_Click
    DoCmd.SendObject acSendReport, "Report1", acFormatPDF, Me.EmailAddr, , , _
    "New Rechargeable repair reference " & ID.Value, "Attached find a new invoice to add to Orchard", True
    Exit_Command60_Click:
    Exit Sub
    Err_Command60_Click:
    MsgBox Err.Description
    Resume Exit_Command60_Click



    End If
    End Sub

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    First open the report filtered to desired record.
    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.

  3. #3
    Join Date
    Nov 2014
    Posts
    5
    Hi thanks for replying, how do I add this filter, everything I do errors, any help appreciated

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Something like:

    DoCmd.OpenReport "report name here", acViewPreview, , "ID=" & Me!ID
    DoCmd.SendObject , , acFormatPDF, Me.EmailAddr, , , "New Rechargeable repair reference " & Me!ID, "Attached find a new invoice to add to Orchard", True
    DoCmd.Close acReport, "report name here", acSaveNo
    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.

  5. #5
    Join Date
    Nov 2014
    Posts
    5
    Hi June

    You are a superstar, thank you soo much for your help

    Andrew

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

Similar Threads

  1. Replies: 4
    Last Post: 06-27-2014, 08:02 AM
  2. Replies: 14
    Last Post: 11-20-2013, 11:27 PM
  3. Replies: 13
    Last Post: 11-07-2012, 03:14 PM
  4. Printing a single record in a report
    By kelann in forum Reports
    Replies: 28
    Last Post: 10-04-2012, 10:07 AM
  5. How to print a single Record's report?
    By yes sir in forum Access
    Replies: 7
    Last Post: 09-20-2010, 07:31 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