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:
ToggleShortcutis 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
Modeset 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
- Check the combination with
Debug.Print Me!navMain.Object.ToggleShortcutin Form view. Letters and digits need Ctrl or Alt; function keys (F12) work on their own. - 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). - On UserForms, give the bar the focus (Tab) before pressing the shortcut, or provide a button that calls
navMain.Toggle.
Related topics
en/wiki/msaccess/comctl/troubleshooting/navigation-shortcut-does-nothing.txt · Zuletzt geändert: von Wolfgang van der Stille