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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error 2451

Status
Not open for further replies.

Lhuffst

Programmer
Jun 23, 2003
503
US
I have a report that runs fine when you click on it directlyl. However, when I try to run the report from a reports menu that passes the report name, I get the error 2451. The reports menu has 25 different reports and all seem to work except 2 and I do not know what to check for. I know the name of the report is spelled correctly and that the report exists. What else should I be checking?

The line that passes the name of the report is
Reports(stdocname).Printer = prt

thanks
lhuffst
 
I have a report that runs fine when you click on it directlyl
If that is the case, the implication is that you can use the default printer, and thus there is no need to change the report's printer. So what happens if you comment out the line that is giving you trouble?

BTW, despite years of programming in Access, I still have not memorized any of the error code numbers, so the actual message of the error would be useful.

 
The error message that comes across says that the report is either named incorrect, doesn't exist or is not open. I knew that it existed and was spelled correctly and that it would open when I went to the reports tab and double clicked the report. I just couldn't get it to do it using a menu (which had previously worked) where you select which report you want. Turns out that I must have deleted a line by mistake.

I had deleted the docmd.openreport statement that is needed before the reports(rptname).printer statement.

Thanks much for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top