Solved

How can I create a custom menu bar?

Posted on 2010-11-09
6
1,008 Views
Last Modified: 2012-05-10
When my database opens, I disable all of the command bars.  When the user opens a report, he needs access to menu item File>Print.  How can I display this in a menu bar without showing all the other menus in the menu bar?
0
Comment
Question by:Saleve
  • 3
  • 3
6 Comments
 
LVL 84
ID: 34091792
Build your own custom menubar and set that to open when your report opens.

To create a new menubar:

1) Click Tools - Customize
2) On the Toolbars tab, click New. Name your new Toolbar.
3) Now add controls and items to the bar. YOu can use the builtin commands by clicking the Commands tab and locating those commands, then drag-drop them to your menubar.

Now open your report in Design view and select your new Toolbar in the properties page. It's in the Other tab, under the Toolbar selection.
0
 

Author Comment

by:Saleve
ID: 34092010
Thank you.  That works well, but it doesn't completely meet my needs.  There are two issues:

1) When the database loads it disables all built-in menus.  Therefore, selecting the custom menu in the properties page of the report isn't enough.  I believe that I will have to enable it when the report loads, otherwise it doesn't open.  (When built-in menus are enabled then the custom menu opens when the report opens.)  Would you please tell me how to do this.  

2) I would like the user to be able to do only three things 1) print the whole report, 2) select specific pages of the report to print, and 3) close the report.  The first and third of these is easy.  But how can I enable the user to print specific pages of the report without giving them the entire File menu?

Thank you again for your help!
0
 
LVL 84
ID: 34092097
<I believe that I will have to enable it when the report loads>

If you set the Report's Toobar property to your new toobar, you'll see that toolbar. Did you try this to see?

<But how can I enable the user to print specific pages of the report without giving them the entire File menu?>

The Print menuitem allows users to select the Pages they wish to print. This is the simplest option, it would seem. Does that not suit your needs?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Saleve
ID: 34092164
Hi.  

Yes, I tried.  The custom report menu does not open when all command bars have been disabled.  Fyi, this is the code I run when the database opens:
 Dim j As Integer
    For j = 1 To CommandBars.Count
        CommandBars(j).Enabled = False
    Next

I don't have (don't know how to find) a print menu that is independent from the File menu.  There is a print command button, but that prints the entire report without letting the user chose specific pages.  Where can I find the print menu?

Thanks!
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 34092256
Have you tried excluding your custom toolbar from the For - Next loop:

For j = 1 to CommandBars.Count
  If CommandBars(j).Name <> "My Custom Toolbar Name" Then
    Commandbars(j).Enabled = False
  End IF
Next

The "Page Setup" option will allow the user to select various options, including which Pages to print. If you need to manage this differently, then you can use the Printer object to select which pages. However, in many cases the actual Page can change based on (a) the amount and type of data presented in the report, (b) the fonts used when printing, (c) various Windows settings and (d) the actual printer being used. In other words, trying to automate this to print ONLY pages 2, 3 and 4 may not produce the results you desire. In virtually all cases, you would be much better off allowing the enduser to select the pages they need to print - or building a report that shows ONLY that information.
0
 

Author Closing Comment

by:Saleve
ID: 34092328

Your first suggestion works.  Thank you.

In the version of Access that I am using, 2003, page setup doesn't allow the user to pick which pages they want to print.  Perhaps a later version does.    Your point is well taken, however, that the user should select the records that they want to see before the report opens.  I always just like the option of being able to print a specific page in case there was a problem with the print, some little piece of information was changed requiring a reprint, etc.  But this isn't too important.  

Thanks again for all of your help.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now