totn Access

MS Access 2003: Create more than 8 switchboard items

This MSAccess tutorial explains how to create more than eight switchboard items in Access 2003 (with screenshots and step-by-step instructions).

Question: In Microsoft Access 2003/XP/2000/97, I want to add 9 switchboard items to the Switchboard. The system only allows up to 8 items on the switchboard menu. Is there any way I can add one more?

Answer: You can not increase the number of switchboard items (beyond 8) through the Access menus. However, you can modify the Switchboard objects directly. We'll go through an example of how to do this.

First open the form called Switchboard in Design View. Under the View menu, select Properties.

Microsoft Access

When the Form properties window appears, click on the property called "On Open". A button to the right (with three dots) will appear. Click on this button. This will open the Microsoft Visual Basic window.

Microsoft Access

Scroll down in the Visual Basic window until you find a subroutine called FillOptions. You will notice in this subroutine that there is a constant declared called conNumButtons. Change the value of this constant from 8 to 9.

Microsoft Access

Your subroutine should now look like the picture above. Close down the Visual Basic editor and save changes, if prompted.

Microsoft Access

You should now be back looking at your Switchboard form in Design View. You should see 8 switchboard items visible on your form.

Next, select the last button and label on your Switchboard. Press Ctrl+C to copy and then Ctrl+V to paste. This should create another switchboard item on your form.

Microsoft Access

Now that there are 9 switchboard items visible on your screen. Select only the 9th button (as seen in picture above).

Microsoft Access

Change the "Name" property for this button to Option9.

Microsoft Access

Next, find the property called "On Click". It should currently show the value:

=HandleButtonClick(8)

Change the "On Click" property to:

=HandleButtonClick(9)

Microsoft Access

Next, select only the 9th label (as seen in picture above).

Microsoft Access

Change the "Name" property for this label to OptionLabel9.

Microsoft Access

Next, find the property called "On Click". It should currently show the value:

=HandleButtonClick(8)

Change the "On Click" property to:

=HandleButtonClick(9)

Now, you can close the Switchboard form and save changes, if prompted.

Microsoft Access

Open the table called "Switchboard Items". It will currently look something like this. The ItemNumber field indicates the position in the switchboard. As you can see there are ItemNumbers 1-8 which will represent switchboard items that you have currently created through the Switchboard Manager.

Since the Switchboard Manager will not let you create more than 8 items, you will need to enter the row that represents the 9th item in your switchboard.

Microsoft Access

In our example, we've created a 9th switchboard item called "9th item" that will open Form2 in Edit Mode.

Let's quickly explain what each field in the Switchboard Items table means:

SwitchboardID is the switchboard that the item belongs to. In our example, we've only created one switchboard, so this value is always 1.

ItemNumber is the position that the command will appear in the switchboard. A ItemNumber of 1 means that the item is the first button on the switchboard, a 2 is the second button, and so on.

ItemText is the text that will appear to the right of the button on the switchboard.

Command tells Access what operation to perform. See below for values.

Command Explanation
0 Title for the switchboard (created by Switchboard Manager)
1 Go to Switchboard
2 Open Form in Add Mode
3 Open Form in Edit Mode
4 Open Report
5 Design Application
6 Exit Application
7 Run Macro
8 Run Code

Argument is the name of the object to open (ie: name of form, report, macro, function, etc.).

Now close down your "Switchboard Items" table.

Microsoft Access

Now if we go back to the Switchboard Manager, you can see all 9 items. If you need to make any edits to the individual switchboard items, you can still perform these through the Switchboard Manager.

Microsoft Access

If you open your Switchboard form, you can now see all 9 switchboard items.

This technique can be used to create as many switchboard items as you need.