Color scheme: Light
You are here: start » en » Documentation » Microsoft Access development tools » WKL Forms Object Library » WKL Forms Object Library troubleshooting » The navigation shortcut does nothing

The navigation shortcut does nothing

Pressing the shortcut of a WklNavBar (Ctrl+B unless ToggleShortcut says otherwise) neither collapses nor expands the bar, or it does in some fields of the form and not in others.

Environment

WKL Forms Object Library 1.24 and later; Access forms and Excel or Word UserForms.

Cause

The bar watches its form's keys through a message hook on the form's thread, so the shortcut works wherever the focus is on that form, including in subforms. It doesn't respond in these cases:

  • A rich text box has the focus (Text Format = Rich Text): the key stays with Access, so Ctrl+B still means bold there.
  • Another form or window has the focus, such as a pop-up form, a dialog box, or another program. The shortcut belongs to the form the bar is on.
  • A UserForm: MSForms doesn't offer a hook, so there the shortcut works only while the bar itself has the focus.
  • No shortcut is set: ToggleShortcut is empty, or the form was saved with text the bar couldn't read (in that case, it uses Ctrl+B).
  • A hidden bar on a UserForm: with Mode set to hidden, the bar can't take the focus, so on a UserForm only code (Mode, Toggle) brings it back. On Access forms, the shortcut does.

Resolution

  1. Check the combination with Debug.Print Me!navMain.Object.ToggleShortcut in Form view. Letters and digits need Ctrl or Alt; function keys (F12) work on their own.
  2. Move the focus to a field without rich text, or choose a combination that Access doesn't use in rich text boxes, such as Ctrl+Shift+N (the Key combination for switching field on the designer's Behavior page).
  3. On UserForms, give the bar the focus (Tab) before pressing the shortcut, or provide a button that calls navMain.Toggle.
en/wiki/msaccess/comctl/troubleshooting/navigation-shortcut-does-nothing.txt · Last modified: by Wolfgang van der Stille