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!

Stuck on OpenReport Method HELP!

Status
Not open for further replies.

garfunkel41

Technical User
Aug 20, 2003
16
0
0
Okay, so I have a form with a command button. When the command button is clicked, a report corresponding to data entered in the form is supposed to be printed. I used the docmd.openreport "reportname" method. It worked once, but now, I get the message that the report is printing and nothing happens. When I step through the code, the program just stops running the code after the docmd.openreport call--it doesn't even go to the "end sub" of the one sub procedure.

Does anyone have any suggestions on what could be causing this? Or better yet, how to resolve it? It's extremely frustrating! THANKS!

"I think there is a world market for maybe five computers." -Thomas Watson, chairman of IBM
 
The sub is ridiculously silly--it's just to print the report.

Sub printReport()
docmd.openreport "report name"
end sub

"I think there is a world market for maybe five computers." -Thomas Watson, chairman of IBM
 
It's called from the cmdbutton_click() procedure.

Another strange thing that I've noticed is that if I use the docmd.openreport method just to preview the report (acviewpreview), the code runs fully each time. My code just doesn't seem to like the openreport method when used to just print the report.

Any ideas?

"I think there is a world market for maybe five computers." -Thomas Watson, chairman of IBM
 
is the Openreport method the only method you run from the command button?
 
no, I first have it call a method that adds the information entered in the form as a new record in the source table

"I think there is a world market for maybe five computers." -Thomas Watson, chairman of IBM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top