Results 1 to 6 of 6
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097

    DoCmd.SendObject acSendReport

    In testing a new function to email reports with the report embedded within the body of the email, I get only a portion of the report as an HTML attachment. The report has header, detail and footer sections that are comprised strictly of label and text box controls. The text box controls are a mix of bound and unbound.



    This is my first attempt to use the acSendReport of SendObject. My email client's compose properties stipulate HTML and plain text. I have manually embedded HTML for years, so I'm not suspicious of compose properties. However, there are functions involved in the setting of Control Source in a few of the unbound text boxes.

    It's my understanding that there are some restrictions with controls in a report. Am I expecting too much here?

    (InvID is a global variable that the report picks up in its Open Event to set a RecordSource filter.)

    Code:
    InvID = 109
    DoCmd.SendObject acSendReport, "rptInvitation", acFormatHTML, "wcsreno@gmail.com", , , "Spring Retreat", , False

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I just tried this with a simple report and it worked.

    What do you mean by "setting of Control Source" - expression in textbox or VBA behind report?

    What happens?
    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
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    As output to a pdf (With the exception of the logo in the image control, all other controls are either text box or labels.)
    Click image for larger version. 

Name:	001.jpg 
Views:	16 
Size:	108.4 KB 
ID:	52265

    As SendObject acReport
    I get empty body with attachment:
    Click image for larger version. 

Name:	002.jpg 
Views:	16 
Size:	20.6 KB 
ID:	52266

    The attachment open in Chrome:
    Click image for larger version. 

Name:	003.jpg 
Views:	16 
Size:	146.4 KB 
ID:	52267

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I can see the HTML does not retain graphics like a check box and data is not preserved. No idea why data is lost because works in my test.
    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
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    I'll try an unbound report with simple text to see if there's something more fundamentally wrong.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    My test used a bound report with one textbox calling a public function. Works - all data is retained, even the calculated.
    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. SendObject acSendReport goes nowhere
    By Paul H in forum Forms
    Replies: 5
    Last Post: 10-09-2015, 08:34 AM
  2. Replies: 1
    Last Post: 07-30-2015, 12:56 PM
  3. Replies: 15
    Last Post: 06-29-2015, 11:12 AM
  4. sendobject acsendreport
    By mikeb in forum Programming
    Replies: 2
    Last Post: 09-17-2011, 03:02 AM
  5. DoCmd.SendObject Help
    By bgreer5050 in forum Programming
    Replies: 0
    Last Post: 01-12-2007, 06:27 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