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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menus on Access forms 4

Status
Not open for further replies.

Jimmy211

Technical User
Aug 8, 2002
42
US
I have a quick question about Access forms. Is it possible to add a menu to an Access form? So that you can have drop down menus like "File", "Edit", "Help", etc? Visual basic has a great tool to do this but I can't find the equivalent in Access.

Thanks in advance for any help.

Jimmy
 
Hi Jimmy,

1)Goto View/Toolbars/Customize
2)On toolbars tab, click New
3)After naming click Poperties on the toolbars tab
4)In the type list click Menu Bar
5)Now you should have an empty menubar displayed on your screen
6)While you are in design view hold down ctrl + alt and select File for example from the main menu bar and drag it onto your bar voila it magically is now inserted into your menubar. Be careful because if you only hold down alt while dragging from main menu to your menu it will act like a cut and paste instead of a copy and paste so always hold down both buttons.
7)Now when in design view on one of your forms go into the property sheets for the form and scroll down to Menu Bar under the ALL tab and you will be able to select your menubar from a drop down list.

Let me know if this helps.

Regards,
gkprogrammer
 
Jimmy, it is possible to create custom menus in Access as gkprogrammer has described. However, it sounds like you want to create a menu bar on the form itself, not a custom menu in the Access window, right? It is possible to do this also, but will involve either adding an ActiveX menu bar control (I believe one comes with MS Office developer edition, and as you've discovered, in VB), or some heavy duty coding in VBA with standard controls to emulate a menu bar.

Try a Google search on "ActiveX Menu Bar Control", you might find what you are looking for...

Ken S.
 
GKProgrammer,

I too would like to add my own custom menus to my databases, However I have tried what you suggested, then When I try and remove some of the options which are listed under the file menu it also removes them from the main menu bar's file menu.

to explain.

I have followed your steps to create my own custom menu called cus_Menu

I then did the CTRL - ALT and dragged the file menu from the menu bar to my cus_menu menu bar.

things were fine. Now I didn't want all the options which come as standard on the file menu, i.e. export, save as open.

so from my cus_menu I right clicked and deleted them assuming that it would just delete them from the Cus_menu. To my surprise when I then went to Access's Menu Bar and looked at the option under File it had the same options as my cut down version of the file menu. i.e. when I removed options from my Cus_Menu it removed them from the File Menu on the Access Menu Bar.

I managed to get them all back by reseting the toolbar. So there is no problem there.

The problem is that I still cannot create my own custom menu bars, while keeping Access menu bars intact.

Can someone enlighten me as to what I am doing wrong.

Idd
 
I posted this before in the Access forum. To repeat:

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.
Click the form view and check to see if it worked.

Also, as suggested, you can use the Activex Menu Bar to place a menu bar on your form.

Neil
 
Thanks Neil,

Your response is appreciated.

I will give it a try on Monday.

Here in UK its coming close to 5 pm so its almost time to drag myself away from my work and enjoy the weekend. woo hoo

idd
 
Hi fneily,

Very thorough, thanks alot for this great answer. Here's a star for your troubles.

Regards,
gkprogrammer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top