Change Customer Menu

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have inherited an application that has a custom menu bar. When I wish to
print any report, it does not open the normal print dialog box, it simply
prints the complete report to the default printer. I want to change this
behavior to open the print dialog box.

There does not seem to any code attached for printing. I have looked in the
modules section with no luck. I have also gone to customize the menu and tred
to reset the print option with no luck.

I am using Access 2003.

Any help would be appreciated. Thanks.
 
Often, when one builds a custom menu, we "steal" the built in menu items (in
fact, a good deal of custom menu building is done via ctrl+drag and drop
from existing menus...and thus no code). However, for your own custom
buttons, you will, and most certainly do write code.

I usually place two buttons on my custom menu that I use for all reports.
You can see a screen shot here:

http://www.members.shaw.ca/AlbertKallal/ridesrpt/test.htm

The code I use (that the buttons call from the menu are).

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


-
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(e-mail address removed)
http://www.members.shaw.ca/AlbertKallal
 
Back
Top