print selected from preview?

H

HX

I have a small application in Access 2000 that generally hides Access from
the user. They can import data and print it in the required format. I've
just added the ability for the user to see the report before it's printed
simply by adding a button that opens the report in print preview mode, and
added a print button to my custom toolbar. Problem is, clicking the print
button defaults to printing ALL the pages - there isn't even a prompt!

How can I give the user the Print Dialog window from a report's Print
Preview page?

Access and VB aren't what I normally do, so if you're going to suggest
coding something, I'd greatly appreciate details!

Thanks much for any help in this.
 
G

Guest

Hi HX,

The easiest way is just to tell them to press Ctrl P

Or you could use this VBA Code with a command button:

Private Sub cmdPrintReport_Click()
DoCmd.OpenReport "YOURREPORTNAME", acViewPreview
Call MsgBox("To Print the page/pages you want" & _
" Press Ctrl P ", vbInformation, _
" How to Print Pages of This Report")
End Sub

Please let us know if this works for you.

Regards,
Hunter57
 
H

HX

Thanks for that - as it turns out, however, I could make a custom button and
assign a macro to it with RunCommand / Print.

I appreciate you taking the time to reply.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top