M
Marcie
I have the following code to send an email to each recipient in the
payrolldetail table. I only want it to send there information but it is
sending everyones. Can anyone see what I am doing wrong?
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("PayrollDetail")
rs.MoveFirst
While Not rs.EOF
strEmail = rs!Email
strid = rs!ID
DoCmd.OpenReport "ContractFacntp", acViewPreview, , strid
DoCmd.SendObject acSendReport, "ContractFACNTP", "PDFFormat(*.pdf)",
strEmail, , , "Contract"
DoCmd.Close acReport, "ContractFACNTP"
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
payrolldetail table. I only want it to send there information but it is
sending everyones. Can anyone see what I am doing wrong?
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("PayrollDetail")
rs.MoveFirst
While Not rs.EOF
strEmail = rs!Email
strid = rs!ID
DoCmd.OpenReport "ContractFacntp", acViewPreview, , strid
DoCmd.SendObject acSendReport, "ContractFACNTP", "PDFFormat(*.pdf)",
strEmail, , , "Contract"
DoCmd.Close acReport, "ContractFACNTP"
rs.MoveNext
Wend
rs.Close
Set rs = Nothing