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!

Printing problem

Status
Not open for further replies.

WarrenTheWindmill

Programmer
Sep 8, 2000
18
GB
I am trying (unsuccessfully) to deploy an application. The application captures concert bookings and then prints contracts for the bands.

The problem is this: I have tested it thoroughly on my machine and it works fine.

When I deploy it on the client machine the print process randomly stops after sending the report to print but before it closes.
The code is as follows:
Code:
DoCmd.OpenReport "rptBookingByArtistPrint", acViewPreview
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "rptBookingByArtistPrint", acSaveNo

The last line of this code fails to run
I have tried everything I can think of to solve this, but to no avail.

I have code in the close event that updates contract numbers on the bookings table, which is not activated if the report is closed manually.

I am using Access 97

Any help would be very much appreciated
 
Hi AngeloDim,
There's something contradictory here as you open in preview then attempt to print then close. Try this:

DoCmd.OpenReport "YourReportName", acViewNormal

Which will simply print the report. You'll never see it and it will be closed on its own. :) Gord
ghubbell@total.net
 
Thanks for that Gord.

I should have mentioned that I need to do it this way because the users want to be able to direct output to the printer of their choice.

I previously ran it the way you suggest without a problem.

 
Alright, have it open in preview and if you don't have a "print menu or tool bar" you might add a message in to the on Open event of the report something like:

MsgBox "Please right-click and select ''Print'' to select your appropriate printer..."

After the print I guess they'll have to close the preview manually? Anyone? :cool: Gord
ghubbell@total.net
 
Just a side note, the Access 97 Developer's Handbook by Litwin, Getz and Gilbert (SYBEX) has a great chunk of code for allowing the user to select which printer they want a report to go to. Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top