Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error - 2501 Need Help

Status
Not open for further replies.

raccess

Programmer
Dec 31, 2002
91
US
Hi All,

I have one Print button on form in that I have following code,

DoCmd.OpenReport RepMainData, acViewNormal

In Report open method I have code to get data from database and populate into reports fields.

Now I’m getting following error while pressing Print button,

2501 – The OpenReport action was canceled.

I checked there are data to print in report. Report is not empty.

Can anyone please tell me what this error means? And what is solution for that?

Thanks in Advance,

Raccess
 
has this worked in the past? if so, what have you changed recently?

is the report name in quotes in your code? it's not in your post, and it should be if it's not.

what is your code in the Report OnOpen method? to test - can you strip out stuff and base the report just on a table or simple query and get it to open?
 
Does the report open by itself (outside of code)?

Duane
MS Access MVP
 
I had the same problem recently. THis resolved the isue.

ref: building/previewing/printing reports in Access 2003

Apparently, report related functinality (building/previewing/printing) in MS Access DBMS is directly effected by the way printing is set up on users PC. Printer that is set up as a default and its driver(s) may cause Access reporting to break!

It has been noticed that combination of MS Windows XP Professional OS, Office 2003 (Access 2003), and HP LaserJet 5/5M printer was causinf break down of reporting. In Windows 2000 Professional environment with the same Office and Printer versions/models/setups reporting was stable and functining properly.

While in the process of installing new driver(s) for HP LaserJet 5/5M printer trivial manipulation with default printers was suggested and "fixed" user with report accessing.
HP LaserJet 4100 PCL 6 network printer was installed on user box and set up as adefault.
After previewing the report in Access user was able to Print the report to the original printer
(in pPrint dialog select another - not default - printer).

We expect the problem to be fixed permanntly after installing appropriate/new driver(s) for
HP LaserJet 5/5M printer on user PC.
 
Hmmm. Interesting, a print driver causing an application error. I can understand if the error occurs while working with reports. Fortunately, I rarely run into the error, but I am at a loss to how a print driver can cause the error when opening a form.

I appreciate the feed back and information.
 
willir, this thread talk about Report, not Form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top