Wednesday, April 07, 2010

Easily Migrate Legacy Access Switchboards to the Access 2010 Navigation Form

In Access 2010 the venerable Native Switchboard Manager has been retired. The old Switchboard form has been replaced by a cool web 2.0 style Navigation Form using a tabs paradigm of up to two levels. The Navigation Form Control and Button controls cannot be created in code, so there is a degree  of hard-coding involved.

I saw the opportunity to ease the design process by adapting the legacy Switchboard Items table and porting it to the new Navigation Form.  I have created a demonstration Access 2010, which can be downloaded from here.  The code can be used freely in your applications 'as is'.  All the required code is behind the custom Navigation Form, which  is pre-built with generic two-level tabs control: 8 level one options and each option having 8 buttons, which are populated at run-time  from the Switchboard Items table, using custom code adapted from the Access 2003 vba module behind the native Switchboard form:









The top level option tabs are equivalent to the legacy Go to Switchboard command, and each top level tab has 8 sub-tabs, which equate to the old Switchboard Items.  At run-time the code behind the Navigation Form assigns to each tab button the Item Text to the Caption property, the Command and Argument values to the Tag property of each button control, and an on-click function for macros and code functions to the OnClick Event.  Form and report objects names are assigned to a button’s 'navigate to' property.  Tab buttons are displayed only for actual item entries. Unused tab  buttons are hidden.

I have also built a Manage Switchboard Items Form to manage the Switchboard Items table and automate the process of upgrading legacy Switchboard Item tables from previous versions of Access. Updated 28 May 2010 so that after an item is deleted all items are automatically renumbered sequentially