So i am trying to email a parameter query report that takes in a date formatted to m/yyyy and compiles a report based on the specific month and year.
however, when i click the command button to email the report, the input box window pops up, i type in a month and year, say 6/2010, then hit enter and then it breaks into the following code highlighting it yellow:
Expand|Select|Wrap|Line Numbers
- DoCmd.OutputTo acOutputReport, strReportName, acFormatPDF, strDestination & strReportName & ".pdf", False
Run-time error 2501
The OutputTo action was canceled.
I wonder what caused the program to cancel the action?
This is the query
Expand|Select|Wrap|Line Numbers
- SELECT user_problem_log.trouble_no AS [Trouble #], user_problem_log.date_closed AS [Date Closed], user_problem_log.user AS [User], user_problem_log.problem_catergory AS [Problem Category], StrConv([brief_problem],3) AS [Brief Problem], user_problem_log.status AS Status
- FROM user_problem_log
- WHERE (((Format([user_problem_log.date_closed],"m/yyyy"))=Format([Enter Month and Year],"m/yyyy")))
- ORDER BY user_problem_log.problem_catergory;