C
Cahrella
I am trying to create a copy of a report in word after displaying it on the
screen. After saving another form is then displayed. It is left to the user
to decide where to save the word document. The following code works fine if
the user selects ok on the form after selecting where to save the report.
However if the user decides to cancel the save I get a runtime error 2501 and
the following form is not displayed. Is there any way of stopping the runtime
error from being displayed and allowing the next line of code to be processed.
DoCmd.OpenReport "Added Since Date report", acViewPreview
DoCmd.Maximize
DoCmd.OutputTo acOutputReport, "Added Since Date Report", acFormatRTF, , False
DoCmd.OpenForm "DisplayOrPrintReport", , , , acFormEdit, acDialog
Thanks
screen. After saving another form is then displayed. It is left to the user
to decide where to save the word document. The following code works fine if
the user selects ok on the form after selecting where to save the report.
However if the user decides to cancel the save I get a runtime error 2501 and
the following form is not displayed. Is there any way of stopping the runtime
error from being displayed and allowing the next line of code to be processed.
DoCmd.OpenReport "Added Since Date report", acViewPreview
DoCmd.Maximize
DoCmd.OutputTo acOutputReport, "Added Since Date Report", acFormatRTF, , False
DoCmd.OpenForm "DisplayOrPrintReport", , , , acFormEdit, acDialog
Thanks