I have a button on a form that calls this code, which perfectly opens a report in print-preview mode...
DoCmd.OpenReport stDocName, acPreview, , "[CandidateID] = Forms![Candidates].form![CandidateID]"
..The problem is, I'd like to have a different button that will automatically export this same report to an RTF file and possibly even go a step further and email to a runtime-specified email address. I don't care much about the code for emailing at this moment, but if you'd like to help with that step, by all means feel free.. I'm using the following code to export to an RTF file (which it does), however it exports ALL records to a super-huge RTF file, because I'm not specifying a certain criteria in the code as I was with the DoCmd.OpenReport, anywho.. heres the code..
DoCmd.OutputTo acOutputReport, stDocName, acFormatRTF, stOutputFileName
How can I limit the creation of the RTF to ONLY match CandidateID as I am with the DoCmd.OpenReport function? Nothing I've tried works! Please help. Thanks!!!!
DoCmd.OpenReport stDocName, acPreview, , "[CandidateID] = Forms![Candidates].form![CandidateID]"
..The problem is, I'd like to have a different button that will automatically export this same report to an RTF file and possibly even go a step further and email to a runtime-specified email address. I don't care much about the code for emailing at this moment, but if you'd like to help with that step, by all means feel free.. I'm using the following code to export to an RTF file (which it does), however it exports ALL records to a super-huge RTF file, because I'm not specifying a certain criteria in the code as I was with the DoCmd.OpenReport, anywho.. heres the code..
DoCmd.OutputTo acOutputReport, stDocName, acFormatRTF, stOutputFileName
How can I limit the creation of the RTF to ONLY match CandidateID as I am with the DoCmd.OpenReport function? Nothing I've tried works! Please help. Thanks!!!!