More Switchboard Buttons

  • Thread starter Thread starter Paul
  • Start date Start date
Hi Paul,

Follow these steps to add more than 8 items to the Switchboard Form:
Do this on a backup of your database first!

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.

The forms you see displayed are actually from one of the
wizard libraries on your system. You cannot change these
forms and code so you are limited to what the original
developers created. If you really start requiring more control
and/or complexity, then it is time to build your own
Switchboard-type main form.

I have an Advanced Switchboard Manager that will allow
up to 12 entries using the interface, but it only works on
Access 97 at the moment. I'm having some difficulty
making it work for later versions due to one small problem.
 
I have an Advanced Switchboard Manager that will allow
up to 12 entries using the interface, but it only works on
Access 97 at the moment. I'm having some difficulty
making it work for later versions due to one small problem.

Jeff,
As soon as you make it available to the world, someone will come along and
want to know how to have more than 12 choices on their Switchboard... <g>
 
Hi Chris,

The problem is getting a list of all macro groups to display in a combo box. In the SBM if you
choose to run a macro the combo box will display a list of the all the macro objects AND the
internal group names. In 97 the code to do this used an entry point 18 in the msaccess executable
file as well as a few other functions, specifically HScr. So my 97 Advanced SBM works just great
using this code.

The problem comes with 2000, 2002, and 2003. Entry point 18 and the HScr were dropped in the Access
executable file after 97 so this one small part of the Adv SBM fails here. Everything else works
just fine. Quite nicely if I do say so myself. So getting a simple list of macro object names is a
piece of cake, but getting the internal names is a royal pain! A past post by MVP Michka says it was
a pain to do this so you KNOW it is difficult.

MVP "Sco" has been kindly dropping some bread crumbs along the way for me to help with this part.
I'm just about to the point of asking, "Please Sir, may I have some more?" I got frustrated and put
it down temporarily while I completed making three other Access Add-Ins. I'm going to dust it off
again now and rub the heads of my Access MVP Bobble-Heads collection for good luck.
 
Yep I know Lynn!
There's no way to please everyone all the time that's for sure.
(Especially when it comes to this topic)
I chose 12 because to date I personally have never seen a post asking for more than that.
 
I chose 12 because to date I personally have never seen a post asking for
more than that.

Well, I want one with 13... and don't go telling me to build it
myself...LOL.

Actually, I'd love to see what you've done with it when it's finished. I
don't actually us the built in Switchboard myself -- I create my own
"menu" -- but it would be neat to see what you've done.
 
See if this won't do what you want:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE MSysObjects.Type=-32766;
 
Hi Lynn,

I wish it were this simple, really.
I'm no macro expert by any means so this had to be pointed out to me by Sco.

Here's a quick test to illustrate:
1. Create a new macro and make sure you can see the "Macro Name" column.
View | Macro Names
2. First line put FirstOne as the name and Quit as the action
3. Second line put SecondOne as the name and Beep as the action
4. Save the macro with the default name of Macro1.
5. Now create a query with the SQL you gave me. What do you see? Just Macro1.
6. Now go to ANY event procedure for any control on a form and click the drop down arrow. Now what
do you see? You should see:
[Event Procedure]
Macro1
Macro1.FirstOne
Macro1.SecondOne

Ahhh haaa, there's the problem! The built-in SBM will display this same list. For 97 they used the
HScr functions, but I have NO idea how they make this work for later versions. To make my Adv SBM
work the same I need to display all the internal macro name groups as well. Sco says it is
"do-able", just very difficult.
 
LOL, well guess what? You can have your 13!
I forgot I actually have 16 options, so there!
<vbg>

Here's some past info on it from Sco and I going back and forth:
I'm sure all the MVPs and experts will look at it as a complete waste of time and would rather spit
on it. I know the experts hate the Switchboard wizard with a passion because of its limitations, but
this is for the beginners and intermediates out there. The Switchboard wizard is obviously used by
many, many people judging by the number of questions that appear in the NGs weekly (and even daily).
And it's always the same questions: "How can I have more than 8 items?", "How do I open a form in
datasheet mode?", "How do I open a query from the Switchboard?", "How do I close the database and
Access?", etc, etc.

My Advanced Switchboard Manager benefits:

1. Up to sixteen items allowed per page (although personally I think this is exceedingly
excessive!!!)
More could be added, but you'd have to add them manually to the table.

2. You can open a datasheet form in Add mode or Edit mode right from the options list without having
to manually change the Switchboard form code.

3. You can open a query right from the Switchboard ( I don't think this is a good idea at all
though).

4. I have one option to just close the database and another to close the database AND Access all
together.

5. Another option will print a report directly to the printer instead of previewing it first.

And it is the same interface that current user's are familiar with. Nothing new to learn.

My ONLY goals on this project were this:
1. Learn something new about Access
2. Create something that will help beginners enhance their switchboard options and alleviate all the
questions about it.

That's it. I'm not forcing anyone to use it and I'm certainly not expecting any experts to use it at
all. I obviously cannot make a form that would appeal to all tastes, just want to make things a
little easier for the beginners. There was a great article in "Smart Access" by George Hepworth last
June which Doug had sent me. He makes some great comments on switchboards and the SM itself and it
gave me some additional ideas. I will say this: we could get 10 developers in a room and there will
be 10 different opinions on switchboards!
No, you wouldn't use it at all Lynn since it is designed for the beginners. But your comments on it
would be great, assuming I can ever get it to work!
 
Back
Top