I have created a report which prints out, emails itself to specific people and then saves itself as a *.RTF file on my C Drive. This works perfectly well but I have to specify the whole path to the file I want. I would like to save the file in a specific folder with the current date as the file name i.e:
"n|\access\daily_updates\17th_November_03"
The code I am using is as follows:
I assusme that the "DoCmd.OutputTo acReport" is the right code to use and would be grateful if someone could advise the way of completing this statement so that it does what I want.
Thanks a lot
John
"n|\access\daily_updates\17th_November_03"
The code I am using is as follows:
Code:
Private Sub Print_Operations_Status_Report_Click()
On Error GoTo Err_Print_Operations_Status_Report_Click
Dim stDocName As String
stDocName = "operational_status"
DoCmd.OpenReport stDocName, acNormal
stDocName = "operational_status"
DoCmd.OpenReport stDocName, acNormal
DoCmd.RunMacro "email operational status"
DoCmd.OutputTo acReport, stDocName, "RichTextFormat(*.rtf)"
Exit_Print_Operations_Status_Report_Clic:
Exit Sub
Err_Print_Operations_Status_Report_Click:
MsgBox Err.Description
Resume Exit_Print_Operations_Status_Report_Clic
End Sub
I assusme that the "DoCmd.OutputTo acReport" is the right code to use and would be grateful if someone could advise the way of completing this statement so that it does what I want.
Thanks a lot
John