I have an email set up to send reports to users, I haven't been able to simplify the process; currently I have to add a new report and a new line in the code. Can I loop through a table sending the proper report to the user. Example of the table I have is below:
Reports-To EmailAddress ReportName
NameOne xxy@dkdkdkd.com Rpt1
NameTwo wrz@dkdkdkd.com Rpt2
NameThree sfg@dkdkdkd.com Rpt3
Code I'm currently using:
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Title = "" ' Define title.
Help = "" ' Define Help file.
Ctxt = 1000 ' Define topic
'Add each report name as A string
Dim stDocName As String
Dim stDocName2 As String
stDocName = "Rpt1"
stDocName2 = "Rpt2"
DoCmd.SendObject acReport, stDocName, "PdfFormat(*.pdf)", "name One", "", "", "Manager Approval", "", True, """"""
Each User/document has it's own line to send an email and it continues to grow.
I appreciate any guidance anyone can give me.
Thanks for the help.
Greg
Reports-To EmailAddress ReportName
NameOne xxy@dkdkdkd.com Rpt1
NameTwo wrz@dkdkdkd.com Rpt2
NameThree sfg@dkdkdkd.com Rpt3
Code I'm currently using:
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Title = "" ' Define title.
Help = "" ' Define Help file.
Ctxt = 1000 ' Define topic
'Add each report name as A string
Dim stDocName As String
Dim stDocName2 As String
stDocName = "Rpt1"
stDocName2 = "Rpt2"
DoCmd.SendObject acReport, stDocName, "PdfFormat(*.pdf)", "name One", "", "", "Manager Approval", "", True, """"""
Each User/document has it's own line to send an email and it continues to grow.
I appreciate any guidance anyone can give me.
Thanks for the help.
Greg