The navigation bar opens in another mode than designed
A form with a WklNavBar opens with the icon column even though the bar was designed expanded, or
with a different width, or with groups collapsed, and changing the design doesn't seem to have any
effect. Other users see the design as intended.
Environment
WKL Forms Object Library 1.24 and later, with AutoSaveLayout on (the default); Access forms and
Excel or Word UserForms.
Cause
The bar remembers what each user did with it (mode, width, pinning, and collapsed groups) per
Windows user under LayoutKey (default “form name.control name”), in the front end's local
USysWklLayout table or, on UserForms, in the registry. When the form opens, the remembered state
takes precedence over the design. Changes made in code count too: a Mode set in Form_Load is
remembered.
An unpinned bar that's designed expanded always opens as the icon column, because a form never opens with the bar lying over the page.
Resolution
- To return to the design for the current user, call
Me!navMain.Object.Reset(for example, behind a “Default view” button); this also removes the remembered row. - To make the design always win, turn off Remember the state per user (on the designer's Behavior page) or set
AutoSaveLayoutto False. - To set a mode in code without it being remembered, set it before the form is shown (
Form_Open) withAutoSaveLayoutoff, or reset the state at the end of the session.
Related topics
- How to: Keep the user's arrangement: the same mechanism for the layout controls