Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Feb 2002
    Thanked 0 Times in 0 Posts

    Cannot access Menu's hotkeys (A2K SR1)

    I have a StartupMenuBar which was opened in a StartupForm. The startup form was not closed until the user closed the program.

    The startup menu has a few menu items which I can access without problem using the mouse, but I can't access them using the menu's ALT hotkey. The hotkey alphabets were unique and there was no redundancy.

    When I exit the program to the Access database windows and run the menu-creating routine from the VBA editor, I could access each of the menu using the ALT hotkey. It looked like the ALT hotkey could not be accessed or active in a form, though accessing and running the item items with the mouse was okay.

    Is there anything amiss?

    Another related question: We can set a StartupForm in Access, but can we set a Sub to run automatically when an Access application is run without using the AutoExec macro and without putting the Sub in a form? Can we name a Sub as AutoExec so that it will run automatically when the program is run?

  2. #2
    Bronze Lounger
    Join Date
    Nov 2001
    Arlington, Virginia, USA
    Thanked 3 Times in 3 Posts

    Re: Cannot access Menu's hotkeys (A2K SR1)

    Don't have answer to first question, when I use custom menus the hotkeys work. Answer to 2nd question is No. Naming a sub "AutoExec" will have no effect on startup (try it and see). You have to run the code from startup form or AutoExec macro. What I normally do is create AutoExec macro with one action, RunCode, that runs the specified sub on startup. The sub has to be declared as a function when using RunCode action. This is no different than running code directly. Except, if startup options are bypassed, the code does not run. I don't know of any way to get around this limitation - there's no such thing as an "Application On Open" event procedure - other than to use security & other methods to ensure startup options aren't bypassed.


Posting Permissions

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