Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advantage of Switchboard vs VBA? 2

Status
Not open for further replies.

merlynsdad

Programmer
Nov 18, 2010
175
US
An inherited Access 2003 database came with an 8 button switchboard. After modifying it for my purposes, I only need 3 buttons, and have removed all of the switchboard buttons and replaced them with 3 command buttons that run VBA in modules instead of macros. The switchboard still opens when the db loads. What is the advantage in using the switchboard's pre-made buttons and code over my own VBA, assuming I know what I'm doing in the VBA?

If the square peg won't fit in the round hole, sand off the corners.
 
How are ya merlynsdad . . .

There's a quite a bit of info on the web. Have a look at What is a Database Switchboard

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
My thoughts?

I looked at the code behind the Access generated switchboard I inherited, and it looked needlessly complicated. I don't know whether it had been modified or not, but I got the feeling that the Access generated switchboard is for those who don't write VBA. By coding the click events on new buttons instead of using the Select Case structure that was there, I was able to dump about 90% of the code, and get a much faster response time. And it does the same thing.

If the square peg won't fit in the round hole, sand off the corners.
 
The switchboard is a generic form with vba code that pulls some data stored in a table. It is meant to be generic and expandable. It puts eight generic buttons on a form, hides them. The table holds the name of the forms, reports, code to open/run and the name of the labels for the switchboard form. When the switchboard opens it reads the table for each record it shows a cmd button and label. I sets the label. When you click on a button it reads the table to determine what action to do. It is pure vba and if you desired you could build something exactly like this. It may look complicated, but that is only because it needs to be generic/dynamic. The form is nothing but a standard form using vba to show/hide controls, and modify label text.

If you build your own form, instead of doing all of this dynamically it is simpler to just hardwire everything. You would write your labels on the form, you would add only the amount of buttons you need, you would put the action in a click event.

Since you do not have to be dynamic/generic, most people build there own switchboard form. Building your own form will give you more flexibility.
 
MajP covered the subject quite well, and his final line really says it all; 'Building your own form will give you more flexibility.'

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top