M
mstery
How do I include field names in the filename of a report that gets
output to an RTF file? Have a confirmation report that's sent as RTF
via email attachment and want the individual's first/last name to
automatically be included in the report's file name. Base report is
named Confirmation Email, when I use a button/OnOpen event to do:
Dim stDocName As String
stDocName = Me![lastname] & "Confirmation Email"
DoCmd.OpenReport stDocName, acPreview, , "[id]=" & [id]
It gets the last name (i.e., Smith Confirmation Email) in the
filename, but I get an error that says the report is misspelled or
doesn't exist so report won't generate (because there is no report
named "Smith Confirmation Email, I'm guessing). Have also tried to
use an Output To macro in an OnPrint event that includes the last name
field in the path to save to, but no luck. What am I missing? Thanks
in advance.
Madeline
output to an RTF file? Have a confirmation report that's sent as RTF
via email attachment and want the individual's first/last name to
automatically be included in the report's file name. Base report is
named Confirmation Email, when I use a button/OnOpen event to do:
Dim stDocName As String
stDocName = Me![lastname] & "Confirmation Email"
DoCmd.OpenReport stDocName, acPreview, , "[id]=" & [id]
It gets the last name (i.e., Smith Confirmation Email) in the
filename, but I get an error that says the report is misspelled or
doesn't exist so report won't generate (because there is no report
named "Smith Confirmation Email, I'm guessing). Have also tried to
use an Output To macro in an OnPrint event that includes the last name
field in the path to save to, but no luck. What am I missing? Thanks
in advance.
Madeline