Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Links Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS SQL
Oracle
DB2
MS Access
MySQL
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» Sitemap
Free Newsletters:
DatabaseDaily  
News Via RSS Feed


follow us on Twitter
Database Journal |DBA Support |SQLCourse |SQLCourse2
 

Featured Database Articles

MS Access

Posted Nov 7, 2002

Access 2000 How To's: Creating Menus Using Access 2000

By David Nishimoto


Overview

My experience with menus has been with Visual C++ and Visual Basic. Both Visual Basic and Visual C++ have wizards to help the developer easily create menu items and subitems attaching code for onclick events. Access 2000, on the other, unfortunately does not. But the good news is that Access 2000 menus are easy to create once you understand the necessary manual steps. This article will walk you step by step through creating a menu.


Create Your Application Menu

  1. Click "View", "Toolbars", "Customize".
    Customize has three tab buttons: toolbars, commands, and options.
  2. From the toolbars tab, click on the "new" button.
  3. A popup dialog box will appear requesting a toolbar name; enter "myApplicationMenu".
  4. A menu dialog will appear.


Create your Macros for Application Forms and Reports

  1. Create Macros for forms and reports next as the menu items or submenu items will run these macros.
  2. Use either OpenForm or OpenReport and initialize the command with the form name.


Adding Menu Items

  1. Click the "Commands" tab from the Customize Dialog.

  2. The Commands tab has two listboxes: Categories and Commands. The order of operation requires you to select a category and drag and drop a command into the menu dialog.

  3. Let's do this. Click Category: File and Command: Custom. Hold the right mouse button down and drag and drop the command into the menu dialog. You'll notice a menu item name "custom" appears.

  4. Change the Menu name by right clicking on the menu item. A popup dialog will appear; change the name to a form or report name. Another way to make the name change is to select the properties item.

  5. The properties dialog has the following textboxes:
        Caption: The display information of the menu item.
        ScreenTip: On hover tooltip.
        OnAction: Select the macro of the form or report you want to launch on a Onclick event.
        Style: Text Only or Image and Text.
        HelpFile: The filename of the helpfile.
        HelpContextId: Context Sensitive help.
        Parameter: Value passed by the menu item.
        Tag: Information that can be used later in the procedure event.


Adding Submenus

This requires dragging and dropping two category types: new menu and file categories. The new menu creates a parent menu item and the file category creates submenu types. This is a little tricky, so hopefully my steps will be clear enough for you to accomplish this task.

  1. Select new menu from the categories and then new menu from the command.

  2. Drag and Drop the menu item onto the menu dialog.

  3. Select file from the categories and then select custom from the command.

  4. Drag and Drop the submenu item onto the "New menu" item. The trick is not to drop the submenu item onto the menu item, but to instead put it in the drop down box below the menu item. This seems simple, but it initially took me about five minutes to figure that out.

  5. Using the properties popup, change the menu and submenu names and OnAction events.

  6. Close the Customize Dialog.

  7. Drag and Drop the menu dialog onto the toolbar.


Activitating or Deactivitating Custom Menus

  1. The custom dialog is used to activate or deactivate toolbar menus.
  2. The custom menu must be open in order to change menu items through the properties dialog.
That's it! Hope you found this walkthrough helpful and instructive.


Back to Access 2000 How To's Series Home



MS Access Archives

Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 




Latest Forum Threads
MS Access Forum
Topic By Replies Updated
Help With Microsoft Access kasy 0 September 4th, 07:35 PM
Linked table not sorting or filtering - ODBC error Java 1 August 28th, 10:37 AM
Use Parameter in select statement (Sql in Microsoft Access) katty.jonh 1 July 25th, 06:45 AM
Query Issue algebroni 7 July 23rd, 04:22 PM