increase the number of buttons on a switchboard

G

Guest

Currently, in the Switchboard Manager, I cannot have more than eight buttons
on a switchboard page. Is there a way around this?
 
F

fredg

Currently, in the Switchboard Manager, I cannot have more than eight buttons
on a switchboard page. Is there a way around this?

You can do this, but a much better solution is to create your own
switchboard using an unbound form with command buttons.
If you use the command button wizard Access will even write most of
the code for you. You can add as many buttons as you wish, you have
more control over it's appearance, and maintenance of the form is
going to be much easier.

Anyway, adding a 9th or 10th etc. button is no problem, hoewever you
cannot edit the extra buttons using the switchboard manager. Any
changes on those buttons will have to be done manually.

Here's how.

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 SwitchboardItems 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 (If this is on the first switchboard.)
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)

Add additional buttons using the same method.

Change SwitchboardID = 1 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 in the SwitchboardItem table.
 
J

Jeff Conrad

Currently, in the Switchboard Manager, I cannot have more than eight buttons
on a switchboard page. Is there a way around this?

Follow these steps to add more than 8 items to the
Switchboard Form. Make a back-up copy of your
database before beginning.

1. You need to create additional command buttons and labels
to match the number of items you want. Easiest way to do
this is to highlight the last command button and label and
select Copy. Then Paste them onto your form to create
additional ones. Now make sure you change the name of the
NEW command button(s) to Option9, Option10, etc. Also
change the name of the NEW labels to OptionLabel9,
OptionLabel10, etc.

2. Now go to the properties area of each new command
button. In the click event, enter the following:
=HandleButtonClick(9), =HandleButtonClick(10), etc. to
match up with your selection. Do exactly the same thing
for the Click event of the labels (unless you turned those
off).

3. Now go to the code behind the Switchboard form. Scroll
down until you come to this line in the FillOptions Sub:
Const conNumButtons = 8
Change that number to 9, 10 or whatever you need.

4. Compile the code, save and close the form.

Now if you use the Switchboard Manager interface you are
still restricted to 8 items. To add more you have to add
the entries manually into the Switchboard Items Table.
Shouldn't be hard to do if you take a few minutes and see
how the records are entered. You can EDIT more than 8
entries from the Wizard, but cannot ADD more than 8.
 
G

Guest

You're right, the unbound form with command buttons does sound much easier!
I am going to try that. Thank you for the info!
 

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