Results 1 to 3 of 3

Thread: RESOLVED: Access 2000 Menus: Assigning Code

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Location
    Bentonville, Arkansas
    Posts
    15

    Question RESOLVED: Access 2000 Menus: Assigning Code

    I have created a custom menu in Access 2000. However, I cannot seem to find how to assign code to menu selections.

    I created the menu from the Toolbar customization screen. In this section, however, it will only allow me to assign a macro...not code.

    Does anyone know how to reference the menu in VBA code??
    Last edited by jtnelso; Oct 15th, 2003 at 02:25 PM.

  2. #2
    Fanatic Member WorkHorse's Avatar
    Join Date
    Jul 2002
    Location
    Where you live.
    Posts
    591
    From Access 2000 help:

    Add a custom command that runs a Visual Basic function to a menu
    Create the function you want the command to run.
    How?

    On the View menu, point to Toolbars, and then click Customize.


    If it isn't already displayed, show the menu bar, shortcut menu, or toolbar containing the menu that you want to add the command to.
    How?

    In the Customize dialog box, click the Commands tab.


    In the Categories box, click File.


    Drag the Custom command from the Commands box over the menu on the menu bar or the toolbar, or under the appropriate category on the Shortcut Menus toolbar. When the menu displays a list of menu commands (or an empty box if it's new), point to the location where you want the command to appear on the menu, and then release the mouse.


    With the Customize dialog box open, right-click the command on the menu, and then on the shortcut menu, type a new name for the command in the Name box.


    On the same shortcut menu, click Properties.


    In the On Action box, type the name of the function you want to run in the format =functionname(). For example, for a custom function named SetCaption(), type =SetCaption(). For a built-in function, enter the name of the function and any required arguments, for example =MsgBox(IIf(Instr(Time(), "PM"), "Good Afternoon", "Good Morning")).


    Specify any other properties for the command.
    Note If you add a command to a built-in menu (for example, the Edit menu), that command appears in all views having that built-in menu.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Location
    Bentonville, Arkansas
    Posts
    15
    Thanks for your help. I actually read that part of the Help file, but it obviously did not register with me.

    Everything works properly now....thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width