Launch Form to Print Preview from Button

Don Eric

Registered User.
Local time
Today, 09:33
Joined
Jul 2, 2009
Messages
12
**Sorry just realised my heading was a bit wrong should be Launch REPORT to Print Preview from Button**


Hi everyone,

I am a bit stumped on this one and hoping someone out there may know the answer. I have created a number of reports that I want users to be able to run by clicking the relevant button on a form. I have used the following script:

DoCmd.OpenReport "rManagementOrganisations"

(rManagementOrganisations being the name of one of the reports)

This works, but tries to print directly to the default printer. What I would prefer is if it would launch the report in the print preview screen where the user can decide if he wants to print it or analyse it in Excel.

Does anyone know if there is a way to get it to do this?

Virtual Fosters on offer!! :D

DE
 
Last edited:
I think you simply need add the following piece of code to do a preview:

DoCmd.OpenReport "rManagementOrganisations", acViewPreview

Also in code editor you can place the cursor in the 'OpenReport' part of your code and press F1 to see the built in Access help options.

One other note - I sometimes give the user the option of exporting the data to a spreadsheet if they need to crunch the data further. This would be executed with a seperate button.
 
Ken cheers mate. That worked perfectly.
 
Cool - Glad you have it working.
 

Users who are viewing this thread

Back
Top Bottom