DoCmd.SendObject 包含子报告的电子邮件报告

DoCmd.SendObject email report with subreports

两部分问题:1. 当我打印报表时,我的子报表没有显示。这有什么诀窍吗? 2. 当我使用下面的代码时,它给我一个错误。我想通过电子邮件发送包含 2 个子报告的主报告,在命令单击时以 .pdf 格式发送。

DoCmd.SendObject ([acSendReport],["AUS_Main"],[acFormatPDF],[heather@gmail.com],,,[AUS Checklist and Orders],["Sir/Ma'am,", & vbln "Attached is my AUS checklist. I have read and understand all information on this document, and will reach out to HRO if I have any unanswered questions."]
  1. 否,整个报告应为 PDF 格式

  2. 考虑:

不需要 [ ] 个字符。开始时也不是单身未成对父母。

电子邮件字符串需要用引号引起来。

消息连接混乱。

vbln 无效,使用 vbCrLf

DoCmd.SendObject acSendReport, "AUS_Main", acFormatPDF, "heather@gmail.com", , , _
     "AUS Checklist and Orders", "Sir/Ma'am, " & vbCrLf & "Attached is my AUS checklist. I have read and understand all information on this document, and will reach out to HRO if I have any unanswered questions."