Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I create a menu bar on a form? 5

Status
Not open for further replies.

robinsql

Programmer
Aug 2, 2002
236
0
0
IE
Hi all,
I am using a form to print ID cards and want to have a menu bar at the top of the form.
I have looked for help on how to do this but am not getting much joy.
Does anyone know how I do this or where I can find out about it?
Any help very gratefully received.
Thanks,
Robin
 
I copied this from my teaching notes, so excuse the format.

Creating a Custom Menu Bar
A) Create a Menu bar first
a. Click View, slide to Toolbars and click on Customize
b. Click the New button
c. In theToolbar Name box, type in a name (such as the database name) for your Menu bar
d. Move the blank new menu bar out of the way of the customize window.
e. In the Customize box, click the Properties button
f. In the Type box select Menu Bar
g. Click the Close button

B) Add some built in menus to your customize bar
a. In the customize dialog box, click the Commands tab
b. Select Built-in Menus in the Categories list
c. In the Commands list, click the File menu entry and drag it to your bar
d. Drag the Edit menu from the Commands list to your bar
e. Drag View, Records, Window and Help to your bar

C) Add your own version of the Tools Menu
a. In the Categories list, click New Menu
b. In the Commands list click New Menu and drag it to your bar
c. Right click the New menu , select the existing text in the Name box and type &Tools and then press enter
d. At the top of the Access window click the Tools menu.
e. Hold down the CTRL key and click the Spelling command. Drag it down to the Tools menu on your bar and drop it in the blank dropdown menu.
f. Repeat to bring the Autocorrect and Options submenus down to your bar.
g. With the right mouse, click the Options command on your menu and then click Begin A Group.

D) Add Another menu to your bar
a. In the Categories list, click New Menu
b. In the Commands list, click New Menu and drag the text to your bar
c. Right click the New Menu on your bar and in the Name box call it something pertaining to the database
E) Add custom menu commands to open forms in your application
a. In the Customize dialog box, click the Commands tab
b. Select All Forms from the categories list
c. In the Commands list, drag a form name to your new menu on your menu bar and drop it off. If you want to change the name to something more user friendly, right click it and type the name in the Name box
d. Let’s say the form finds a record of some type. You want to put an Icon on the menu bar. Steal the binoculars from the Find command by doing the following: Right click the Find button and then click Copy Button Image. Then click your menu and right click and click Paste Button Image.
e. Repeat above steps for the forms you want to use.
F) Tell your Form to use the created Menu bar
a. Drag the new menu bar to the top and dock it.
b. In the Customize dialog box, click the Toolbars tab and click on the check next to your new menu bar to hide it. You only want it to show when your form is opened.
c. Close the Customize window.d. Go to the Design view of your form and open the forms Property Sheet.
e. Click the Other tab of the sheet
f. Set the MenuBar Property to your menu bar.
g. Click the form view and check to see if it worked.

Whew! Neil
 
Hey Neil,
Thanks a million for the help. The only problem is that the menu bar is not actually on the form. It is appearing at the top of the screen with the other menu bars. How can I fix this?
Robin
 
in case this is a really dumb question, i'll refer you to the anonymous individual who once said "there's no such thing as a stupid question". with that said, what do you do after you've added a bunch of menu items to the menu bar (per fneily's generous recipe) and wish to delete one or more of the items (e.g. i wouldn't want my users to be able to print, so i'd like to carve it from the file menu item i added)?

thanks in advance.
 
Actually a very good question, which I didn't address. When you click on View, Toolbars and then Customized, you throw all the toolbars and menus into edit mode. To delete or remove an icon or choice, you can either use your mouse to drag it off the toolbar until you see a X, and then when you let go of the mouse it disappears, or right click on a menu item and select delete.

Neil
 
kind of an aside...but does anyone know if it's possible to transfer a customized menubar/toolbar from one database to another?

Thanks, Janel
 
when you use the 'get external data' feature and try to import (parts or all of) another database into the target db, the dialogue window has an 'options' button -- click and you'll be prompted to import (among other things) menus and toolbars. hope that helps ya.
 
Awesome!! I think I got it figured out.

One thing to note for anyone curious about this is that (for me at least)it does NOT prompt you for which menus/toolbars to import. I just selected the option and then imported a module to test it. It went ahead and brought the menubars over along with the module. Also, it won't import if you already have a menu/toolbar by the same name in the database.

Thanks uscitizen!!!
 
It seems the question about having the menu right on the form was overlooked. I don't know if its possible to put real menus directly on a form, but I had an idea you might try.

Create your own! With a little experimentation you should be able to duplicate at least the functionality of a menu bar. For example:

For the main menu items, use command buttons with their backstyle set to transparent. If you want them to have some interesting appearance, you can place a label UNDER the transparent button, and format the label pretty much any way you want.

Then, in the code for the command buttons, have them make some list boxes visible. The list boxes would have your menu items in them. In the on click of the list box, you detect which item was selected, take the appropriate action, and then move the focus back to the transparent command button ("main menu item", if you will), and set the listbox to not visible again.

I can't thing on any reason why this wouldn't work. Hope it helps.
 
perhaps i've not read something already posted to this forum, but i noticed that when i open my database directly with a switchboard menu that there are certain functions atop the screen (before even venturing into any of the menu configurations i've created for forms when they're opened via the switchboard menu options) that have been stippled out and some which have not. i've tried to copy down those which seem to be still accessible by the user, and they were the 'save', 'print', 'print preview', 'spell check', 'find', 'properties', 'database window', 'new object' and 'ms help'. of the bunch, the only one i (currently) believe my user should be let have is the 'ms help'. [incidentally, i am talking about icons which have tooltips which are activated when hovering over each]. so, i guess my question is, how can the functions on this be accessed by yours truly and either be re-granted or denied to the user. at this point, ms a2k security comprises one overall database password -- the default.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top