working with custom menus

G

Guest

I have created a custom menu in my Access program. The custom menu has three menu items: File, Reports, and Exit. I have the custom menu selected in the startup so the user does not see any other menus while the program is running. However on my custom menu under the File menu, I have a Print option. This is the print command from the Standard toolbar. So no matter what they are doing in the program, whether they are in a form or query or wherever, the Print option is available to them by clicking on the file menu. Logically this doesn't make sense. The print command should only be available when the user is in a report. Any ideas?? I have tried making another menu bar with just a File/Print option, but how do I get the only this menu to show when they are in the reports and not both menus

Thanks in advance for any help.
 
A

Albert D. Kallal

Simply create a nice menu bar for printing. On that menu bar put a few nice
options like print, print to a specify priter.

I even have a email button. I would suggest that you raid a few of the
buttons from the built in print preview bar.
Here is a screen shot of the menu bar I made...

http://www.attcanada.net/~kallal.msn/test/test.html

Then, all you do is specify the menu bar in the reports setting. When it
opens..you see your custom menu bar..when you close..you see your custom
main bar. This is ideal..since you don't have to write a bunch of code to
set the menu bar. If you switch to your form and accidentally leave the
report open..the menu bar switches for you....

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

The above is the actaul code I use for the custom menu bar.
 
D

DebbieG

This is what I use:

Private Sub Report_Open(Cancel As Integer)
DoCmd.ShowToolbar "MyPrintPreview"
DoCmd.ShowToolbar "MyDatabaseToolbar", acToolbarNo
DoCmd.ShowToolbar "MyDatabaseMenuBar", acToolbarNo
End Sub

Private Sub Report_Close()
DoCmd.ShowToolbar "MyPrintPreview", acToolbarNo
DoCmd.ShowToolbar "MyDatabaseToolbar"
DoCmd.ShowToolbar "MyDatabaseMenuBar"
End Sub

HTH,
Debbie


I have created a custom menu in my Access program. The custom menu has
three menu items: File, Reports, and Exit. I have the custom menu selected
in the startup so the user does not see any other menus while the program is
running. However on my custom menu under the File menu, I have a Print
option. This is the print command from the Standard toolbar. So no matter
what they are doing in the program, whether they are in a form or query or
wherever, the Print option is available to them by clicking on the file
menu. Logically this doesn't make sense. The print command should only be
available when the user is in a report. Any ideas?? I have tried making
another menu bar with just a File/Print option, but how do I get the only
this menu to show when they are in the reports and not both menus?

Thanks in advance for any help.
 

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