【发布时间】:2014-04-18 17:46:21
【问题描述】:
我不是非常精通或接受过代码等方面的正式教育,但我需要一些帮助,在 Access 2007 模块中工作并添加一两行以在没有返回记录时不发送电子邮件。
这几乎就是我现在正在使用的东西:
Function Random_Report()
homepath = "\\server\folder\folder2\folder3\"
strFileName = "Random_Report” & ".xls"
DoCmd.OutputTo acOutputQuery, "Random_Report", acFormatXLS, homepath & strFileName, False
DoCmd.SendObject acSendQuery, " Random_Report ", acFormatXLS, "Someone2@company.com", , , _
" Random_Report ", "Good Afternoon Someone," _
& vbNewLine & "The Random_Report is ready for review at "\\server\folder\folder2\folder3\ and is attached to this email." _
& vbNewLine & "" & vbNewLine & "Thanks," _
& vbNewLine & "" & vbNewLine & "Someone Else", False
所以无论如何它都会发送报告,但是当报告为空白时,我可以添加什么来阻止它发送电子邮件?
【问题讨论】:
标签: sql ms-access module ms-access-2007 vba