Give an application its own navigation pane
In this tutorial, you use the navigation pane designer to arrange the navigation pane of a small database: a category with two groups, display names for the forms, a group that appears only during development, and a pane that opens on the first group. It takes about ten minutes and needs only one line of VBA.
Prerequisites
- Microsoft 365 Access, 32-bit or 64-bit, with the WKL Forms Object Library 1.50 or later installed and registered for the current Windows user (How to: Install the released package).
- The WKL Extensions add-in installed, so that Database Tools › Add-Ins offers WKL Navigation Pane Designer:
tools\install-addin.ps1in the release package (1.55 or later) installsaddin\WklExtensions.accdafor the current user. Without the add-in, you can also open the designer from the Immediate window:CreateObject("WklForms.NavPane").ShowDesigner. - A database in a trusted location with the forms
frmCustomersandfrmProducts, the reportrptStock, and the tabletblCustomers.
Steps
1. Open the designer
Choose Database Tools › Add-Ins › WKL Navigation Pane Designer. The designer opens on the Category page, with a category named after the database.
2. Name the category
Under Name, type Data Source. Leave Hide unassigned objects on, so the pane shows only what you put into the category.
3. Create the groups and entries
On the Groups and entries page:
- Click New group and name it Master Data.
- Under Objects, select
Form frmCustomersandForm frmProducts, and click Add to group. - Select the
frmCustomersentry and type Customers under Display name; namefrmProductsProducts. - Click New group, name it Reports, and add
Report rptStockwith the display name Stock. - Click New group, name it Development, add
Table tblCustomers, select the group, and select ACCDB under Visible when.
The preview on the right shows the pane as Access will display it, with the entries of each group sorted by display name.
4. Choose the start group
On the Category page, under Start group, choose Master Data.
5. Save
The Check page reports ready to save. Click OK: the model is saved and applied, and the pane shows the Master Data group with Customers and Products.
6. Apply the pane at startup
The Development group is written for the database the model was applied in. So that an ACCDE file made from this database leaves it out, apply the model when the application starts, for example in the Load event of the startup form:
Private Sub Form_Load()
CreateObject("WklForms.NavPane").Apply
End Sub
Expected result
The navigation pane opens on Master Data in the Data Source category, and the pane's category list offers Data Source next to the built-in Access categories. In the ACCDB file, the Development group shows the table; in an ACCDE file, the group is missing. The model is stored in USysWklNavPane and comes back in the designer the next time you open it.