473,396 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Error when emailing a parameter query report

Hi there..

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
  1. DoCmd.OutputTo acOutputReport, strReportName, acFormatPDF, strDestination & strReportName & ".pdf", False
the error message is:

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
  1. 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
  2. FROM user_problem_log
  3. WHERE (((Format([user_problem_log.date_closed],"m/yyyy"))=Format([Enter Month and Year],"m/yyyy")))
  4. ORDER BY user_problem_log.problem_catergory;
and the report was created using that query.
Aug 10 '11 #1
2 1769
Rabbit
12,516 Expert Mod 8TB
First thing first, does that query work by itself?

I suspect not. Format expects a date. A string in the format of m/yyyy is not a valid date string. And since you are passing a string, you would still need to convert that string to a date first. But that's moot, there's no need to convert the user input to a date and then to m/yyyy since they will be entering it in that format anyways.
Aug 10 '11 #2
@Rabbit:

Yes the query works.

i know what's the problem lol.. it's the naming convention..

i put a "/" in the query name and report and windows file names cannot have a / in the name... so what access did was replaced the / with a _ and that changed the whole report name, hence it was canceled.

Problem Solved!

:D
Aug 10 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Al Kolff | last post by:
Don't know if this is new news, old news or no news. Every time I tried to email with my php/mysql combo I would receive a email back from the system administrator with about 5 of the addresses...
5
by: Jimmy Tran | last post by:
Hello, I am doing a bmw tracking project for school using asp and access2000. on my search.asp page, I can search for a particular bmw and order it if i want. It works fine when i do select query...
2
by: MJ | last post by:
Hi, I'm hoping this is relatively easy. I have a report based on a query - when you run the report, a form opens up and you are prompted for a date range. These are combo boxes (ie. January...
1
by: Wayne Aprato | last post by:
I have a couple of Access 2000 and 2002 databases which have exhibited the following behaviour. The mdb works fine but the mde causes access to shut down on an error when a particular query is...
15
by: Richard Hollenbeck | last post by:
I tried to ask this question before on the 14th of January but I never got a reply. I'm still struggling with the problem. I'll try to rephrase the question: I have a crosstab query with rows...
2
by: Randy | last post by:
Whenever I do a query it works correctly on two fields when it is run and brought up in datasheet view, but whenever I attached it to a report it only brings up one parameter that I specified...
2
by: Matt W via AccessMonster.com | last post by:
I based my parameter query off the following posting, but can't seem to work out a little kink. I cannot bring up a report without first typing in the month and year three times. The first time for...
1
by: allie357 | last post by:
I am trying to add a form with a combo box to an existing parameter query report. I followed the directions from this link:http://office.microsoft.com/en-us/assistance/HA011170771033.aspx ...
3
by: juliehg | last post by:
Hi, I'm currently using MS Access 2000 to keep all my actors measurements, resumes and personal details on a database. To upload their details onto our website, I have built an event so when I...
1
by: Tami Robinson | last post by:
I keep getting !Overflow error when running this query: SELECT DISTINCTROW FamilyInfo.FamilyInfoID ,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.