Custom menu and print

  • Thread starter Dimitris Nikolakakis
  • Start date
D

Dimitris Nikolakakis

I have a created a report that is called from a form in preview mode. I have
created a right mouse menu and I have put there the print button. My problem
is that the print is done without asking me the printer but it goes directly
to default printer.

If I use the command from the menu (File --> Print) then it is OK.

thanks
Dimitris Nikolakakis
 
A

Albert D. Kallal

The code I have my custom menu bars run is a follows:


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. (if you don't have any forms with timers..then you
can remove the select object above)

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
 
P

Pieter Wijnen

this is normal behaviour, seleting print will always print to the default
printer
selecting file-> print or ctrl +P will bring up the print dialog.
don't have the app and or code in front of me, but as far as I recall you
can invoke the print dialog from a shortcut menu

HTH

Pieter
 
Top