Switchboard Question

T

TomP

I noticed that the switchboard is only limited to 8 menu selections per
switchboard. Can that be increased? If so, how can I modify it?

Thank you,
 
F

fredg

I noticed that the switchboard is only limited to 8 menu selections per
switchboard. Can that be increased? If so, how can I modify it?

Thank you,

Adding a 9th or 10th etc. button is no problem, however you cannot
edit the extra buttons using the switchboard manager. Any changes on
those buttons will have to be done manually.
There are better methods of creating a switchboard, but if you wish to
modify the built-in switchboard here's how.
We'll add just one button.

In design view, select the 8th button. Copy it. Paste it.
Drag this new button and label and align it under the others.
Name this button "Option9".
Change the button's Click Event to:
=HandleButtonClick(9)

Rename the attached label
"OptionLabel9"
Change it's Click event to:
=HandleButtonClick(9)


Open the switchboard code window and change
Const conNumButtons = 8
to
Const conNumButtons = 9

Close the code window and save the changes.

Open the Switchboard Items table

Add a new record.
The actual data depends upon what you want the new button to do.
Let's say you wish to open a form for editing.

SwitchboardID = 1
Item Number = 9
Item Text = Open form whatever (this is the label text)
Command = 3 this is the constant number to open a form for editing)
Argument = frmWhatever (this is the actual name of the form)

Note: You can read the other available Command values in the
Switchboard's HandleButtonClick function code.

Add additional buttons using the same method.

Change SwitchboardID to whatever the actual Switchboard number is.

Again , you won't be able to use the manager to edit the additional
button. You'll need to do it directly in the Switchboard Items table.

A better solution would be to create your own switchboard using an
unbound form and command buttons. If you use the Command button wizard
to add the buttons, Access will even write most of the code for you.
You will have more control over the switchboard appearance,
functionality and usage. Plus you're not limited to the 8 buttons.
Maintenance will be much simpler.
 
K

KARL DEWEY

This is not recommended by those that are better than I am!

First backup the database as I once while messing with the code under the
switchboard hosed it so it could not be opened.

Next open the switchboard in design view.

Copy and paste the command buttons and labels. The bottom one is named
Option8 and OptionLabel8. When you paste them they will have a different
series of names like Command28 and Label24. Rename them following the
original naming convention.

Edit the On Click property from =HandleButtonClick(8) to the next
consecutive as =HandleButtonClick(9) for both the command button and label.

Next on the menu click on VIEW – Code. Scroll down to find –
Private Sub FillOptions()
' Fill in the options for this switchboard page.
' The number of buttons on the form.
Const conNumButtons = 8
Change the 8 to the maximum number of buttons.

Save and close the Visual Basic Editor.

Compact and repair. Close. Open add to the Switchboard table. Test.

Good luck.
 
K

Klatuu

The other posters have offered workable advice. But, as fredg points out,
you will not be able to use the Switchboard Manager for the additional items.
If I used the Switchboard (which I don't because of it's limitations), what
I would do is use the first page of the switchboard to open additional
switchboard pages. Then put the action items on those pages. Group your
actions logically together for each page, of course.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top