我需要根据报告的GROUPED BY向MS Access 2013发送报告的部分内容。
第二个最佳案例:每个分组的部分都有一个按钮。单击每个按钮时,该部分所按的“UW”将仅接收分配给它们的行。
来自Access 2013 VBA: Query recipient email address的这个VBA w / SQL脚本允许我创建一个发送给UW的Outlook电子邮件,但不一定是报告分组的UW。
Dim varSubject As Variant
Dim varBody As Variant
Dim email as string
Dim sqlSTR as string
Dim r As DAO.Recordset
Dim varInitials as string
Dim dbs as DAO.database
set dbs = currentDB()
varInitials = "P.UW"
sqlSTR = "SELECT E.Email FROM Employee E INNER JOIN ProposalTracking P ON
E.Initials = P.UW WHERE " & someField & " = & " & """" & someVariable & """"
Set r = dbs.OpenRecordset(Name:=sqlSTR , Type:=dbOpenSnapshot)
varName = r![Email]
r.close
varSubject = "Today's Proposals"
varBody = "Please see the proposals which are assigned to you."
DoCmd.SendObject , , , varName, , , varSubject, varBody, True, False
如何通过电子邮件将报告分组的多个UW发送给尽可能少的点击次数?