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

How to close a preview report once PRINT is pressed

Status
Not open for further replies.

franksirvent

Programmer
Mar 8, 2002
358
GB
Hi, I have several reports which I preview PRIOR to printing them.
Once in Preview mode, I press the PRINT button on top to print it as you would...
I need the report preview to close (and go back to original form).
I already know how to go back to the form, but I am not sure how to close the preview mode once Print is pressed...

Any ideas ???

Thanks in advance
 
You could try using VBA in the report footer section's OnPrint event (as this will be the last thing to print) to close the form.

Something along the lines of
Code:
DoCmd.Close
maybe?

HTH [pc2]
 
Hi thanks for your help

Sorry, that gives me an error (it cannot close because hasn´t finished printing yet...)
 
Open the report from a form and close the report from that form. The error is prolly from trying to close the report from within the report.

 
THANKS FOR YOUR INPUT.

I cannot view the FORM as the report preview is on full screen. So your option to close and open from within the form is not viable.

This is what the User does:

1. Display a quote form. Press print button to preview first.

2. The report appears on preview mode. The user now prints the report or closes the report (2 buttons on top to do so)

3. If they press the print button within the report preview, I then need it to automatically close the preview report, and then display the original form.

Basically once the user has printed the report the logical thing is that the CLOSE the report preview as they have finished with it. I´ve given them a CLOSE button, however I want Access to close the preview once PRINT has been pressed and go back to the original form...



 
Hi

I do not qhite follow where the buttons you speak of are located, but if trhey work as you say then..

Why not, in the existing code of the print button

...existing code
cmdClose_Click

ie after executing the print code, execute the close Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
hi there jane2geo

Sorry, no, I couldn't work it out.
I finally decided to just put a CLOSE button on top (next to printing) that people press to get out of the preview and back to the original form...
Sorry I can't help you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top