Bring up Print Options from Custom Toolbar Button

C

cpocpo

Hello.

I have a custom toolbar for my database.

When I use my "Report Switchboard" with command buttons, they all
Preview their respective reports. When I hit the custom toolbar Print
button, it prints the full report instead of allowing a choice to
print certain pages or select printer.

What I would like is when the toolbar Print button is pushed for a
particular report being previewed, it would bring up the Print option
box similar to what comes up using the normal Access menu (File>Print)
(Printer selection, print range, and number of copies). The same
button should also work whether a form or report is the thing on the
screen.


Any ideas?

V/R

LostGuy
 
J

Joan Wild

You can copy the File, Print item from the main menu to your custom menu (via Ctrl-drag), however if you turn off 'allow built-in menus' in Tools, Startup, you'll find that File, Print will disappear from your custom menu.

Instead of copying from the built-in menu to your custom menu, use a function, and assign it to the OnAction property of your menu item.

Public Function PreviewPrint()
DoCmd.RunCommand acCmdPrint
End Function
 
C

cpocpo

Joan,

That did it and it works great! Now I can print one page of a report
from the Preview screen (rather than printing out the whole report for
all records every time)!

Appreciate the help!

V/R

LostGuy
 

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