Switchboard Question

D

Dale

Has anyone created a switchboard, that where instead of the usual, clicking
on a button to open another switchboard, it would instead tabulate each
switchboard with buttons in each tab?

If anyone has any idead on how to do this, I'm all ears.
Thanks... Dale
 
J

Joan Wild

Just create an unbound form. Add a tab control and then all the buttons you
want on each tab.
 
D

Dale

I know this sounds like a simple solution and it would work this way, but
then the form would have to be customized for every change instead of using
the Switchboard Manager.
 
P

Pat Hartman

The switchboard manager does 2 things.
1. It creates a standard switchboard form with a lot of code and it saves it
under the name "Switchboard"
2. It creates and manages a table to keep track of all the info you entered
to the wizard. The table name is "Switchboard Items".

You can make your own form to display the data in the Switchboard Items
table. You will need to be comfortable with VBA because it will require a
great deal of code if you want to get fancy at all. To begin with,
familiarize yourself with the code behind the existing form. You'll need to
replicate most of it.
 
J

Joan Wild

Most folks consider the switchboard manager an overly-complicated tool.
It's much simpler to create your own form - no need for a table.
 
J

Jeff Conrad

in message:
Has anyone created a switchboard, that where instead of the usual, clicking
on a button to open another switchboard, it would instead tabulate each
switchboard with buttons in each tab?

Hi Dale,

I seriously considered integrating a Tab Control into my Advanced Switchboard Manager add-in, but
eventually abandoned the idea even before beginning. When I thought about the complete process on
paper the concept just did not seem very feasible. Perhaps an overview of my thought process will
show you why I abandoned this idea.

The Switchboard Manager (SBM) wizard builds a series of menus by taking information from the
Switchboard Items table. The form that the SBM creates has a set number of controls. Specifically,
eight command buttons and labels (more for mine), as well as some other non-essential stuff. We'll
focus just on the command buttons and labels for this discussion. Once the form is created the first
time, it is not *necessary* for any more controls to be added in order for things to work properly.

The code behind the form will toggle the visibility of the labels/buttons for each menu based on the
table information. The caption in the labels will also change according to the various menus.
Because of this layout and code, everything works just splendidly. Even if you add 100 sub-menus to
the table through the wizard, no more controls are ever required by the form.

Now let's look at a Tab Control. The SBM could easily create a tab control and put the eight
buttons/labels onto it when the
form is first created. Piece of cake actually. So now imagine seeing the tab control with one, and
only one, page displayed.
The caption in the tab control page could be the name of the menu. Still, easy going here. With me
so far?

Now let's say you need to add a sub-menu. What would be required in order to make this happen?

1. You would need to add another page to the tab control itself. In order to do this, the SBM would
have to open the Switchboard form itself in Design View and add another page to the Tab Control. The
current SBM never has to open the form in Design View once it is created the first time.

So we have already ran into our first big problem. Do you see what it is? Our Tab Control SBM could
never, ever be ran
on an MDE file! The current SBM can be run on an MDE (after first creating everything of course) to
make adjustments to the individual menu items. The tab control SBM would not have this capability.

2. Our second page would have to its **own** eight command buttons and labels as well! Again, cannot
do this with an MDE file because we would need to open the form in Design View and create more
controls. Why would the second page have to have its own buttons and labels? Well if you think about
it, if you click on the second tab page you naturally would not be able to see the buttons/labels on
the first tab page. See the problem? We would have to make more coding changes to the form itself as
each button/label would be tied directly to one, and only one, record in the table. Right now with
the current SBM, all the records "share" the same buttons and labels. Follow me?

3. What happens when you need more and more sub-menus? As you can see, we have to keep adding more
and more controls to the form. There is a distinct possibility, though unlikely, that you could at
some point reach the maximum number of controls allowed for on one form by creating and deleting
controls.

4. What happens if we need to delete a sub menu? We would have to delete the tab page and all the
controls on that page. Not extremely difficult, but still a lot more coding work.

As you can see, this would be *quite* an undertaking to create an add-in that does this. Very, very
difficult and fraught with problems. We *could* create a tab control with a boat-load of pages and
controls when the wizard would first run, but what a nightmare for sure.

So in conclusion, Joan's advice is the best option. If you want to have a tab control for your main
menu, you are really better off just creating an unbound form by hand and manually creating all of
the options you want to see on each page.

Probably not the answer you were hoping for, but I hope this helps.
 
D

Dale

Jeff, Joan, everyone,

Thanks for your help. I'm a pretty good programmer and I knew what I was
getting into. All the suggestions you gave me were right on in regards to
designing a Form that would still work under the switchboard manager, and
like Jeff mentioned that endeavor is futile. Just too many tabs and buttons
to create, and the switchboard manager allows for as many switchboards as you
want to make.

I know it was a silly question but I thought I would give it a try.
Joan's solution is the best possible solution.

Thanks again everyone... Dale
 
J

Jeff Conrad

in message:
Jeff, Joan, everyone,

Thanks for your help. I'm a pretty good programmer and I knew what I was
getting into. All the suggestions you gave me were right on in regards to
designing a Form that would still work under the switchboard manager, and
like Jeff mentioned that endeavor is futile. Just too many tabs and buttons
to create, and the switchboard manager allows for as many switchboards as you
want to make.

I know it was a silly question but I thought I would give it a try.
Joan's solution is the best possible solution.

Thanks again everyone... Dale

You're welcome Dale.

I would not necessarily call the attempt futile, just incredibly time
consuming and complex. It would actually take you *less* time just
to make an unbound form with a tab control.

Good luck with your project.
 
Top