Printing reports

Dave_cha

Registered User.
Local time
Today, 20:02
Joined
Nov 11, 2002
Messages
119
I have a form which displays a pile of info.

I want to have a 'Print' button which when pressed will print the info on the form using an underlying report template...WITHOUT displaying the report on screen first.

I can do this using the cmd "DoCmd.OpenReport stDocName, acNormal" but this doesn't bring up the print options box (to select page no., copies etc). If I use "sendkey (^ p)" to bring up the print options box the form will print and not the report.

Does anyone know how to bring up the print options box and then print the current info on screen using the underlying report?

Thanks, Dave
 
Help says to use PRINTOUT instead of OPENREPORT, but I have never used it so I can offer no other suggestions.
 
Thanks, I'll give it a go
 
Not too sure about bringing the print options up, but I use a similar kind of thing in my work database. I did it by having the 'Print' button on the form run a Macro, with the Macro being setup like this:

Action: OpenReport
Report Name: [my report]
View: Print
Filter Name: [my report]

When the user clicks 'Print' fromt he form, it sends the filtered data straight into the report and prints it without a preview.

HTH
 
convert the macro to get the code

just a thought but it might work

why dont you set up the macro and then use the convert macros function to convert it to code that way you can find out how to do it in code in the future ?
 

Users who are viewing this thread

Back
Top Bottom