NEED TO CREATE A CUSTOM MENU WITH PRINT BUTTON

  • Thread starter Thread starter HERNAN CASTRO
  • Start date Start date
H

HERNAN CASTRO

HI GROUP, I NEED TO CREATE A CUSTOM MENU WITH A PRINT
BUTTON THAT BRINGS UP THE PRINTER DIALOG BOX. SO THE USER
CAN SELECT THE PRINTER.. I HAVE USED THE PRINTER BUTTON
INCORPORATED IN THE MNU BUT IT SEND THE IMPRESION RIGHT
AWAY

HERNAN
 
If you copy the "Print..." item from the File menu rather than the "Print"
button from the PrintPreview toolbar, you will get the dialog you are
looking for.
 
It does not do work!

I have copied the print button from the file,
printpreview,etc.. and all of them send the report or form
straight to the printer...

hernan
 
Sorry I wasn't more specific.

Don't "copy" the File>Print button from the Customize Toolbar interface. As
you have discovered, it doesn't behave the same as what is on the actual
File menu. The only work around I know of is to copy it from the File menu
directly.

While in Customize mode:
1) Activate the actual File menu. Select and drag the "Print..." button from
the File menu to your custom toolbar.
2) *IMPORTANT!* Click "Reset" for the MenuBar or it will be missing
File>Print... (this changes what would otherwise have been a "Move" into a
"Copy")
 
I use the following code on my menu bars:

The select object command is needed to fix a "focus" bug if you have a form
with a timer function.

For the code that pops up the printer dialog (so the user can change
printers etc).

You can use:

On Error Resume Next
DoCmd.SelectObject acReport, Screen.ActiveReport.Name
DoCmd.RunCommand acCmdPrint

The select object command is needed to fix a "focus" bug if you have a form
with a timer function.

The code to print right to the printer while in preview mode can be:

On Error Resume Next
Dim strReportName as string
strREportName = Screen.ActiveReport.Name
DoCmd.SelectObject acReport, strReportName
DoCmd.PrintOut acPrintAll

So, often my print menu bar has both of the above options. You can see a
screen shot here:

http://www.attcanada.net/~kallal.msn/test/bu1.gif
 
Back
Top