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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Switchboard 2

Status
Not open for further replies.

voltarei

Technical User
Oct 25, 2006
40
GB
Last one tonight I promise.

Is there any way of having more than 8 items per switchboard?

Phil
 
Sure! A switchboard is just a pre-designed form. You can go into Design View for your switchboard and work with it like any other form! Select the Option Button and Option Button Label, right click, copy then paste. When you do this on a form copying a control, the copy of the control usually disappears! To make it appear, after you hit Paste, hold down <Control> then use your <Down Arrow> and <Right Arrow> to bring the copied contol down onto the form and into place.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Of course you would have to write your own code for any controls you add - the Switchboard Manager would not be aware of them.
 
Many thanks for this advice.
I have managed to copy the button and label in design view and paste the new item on the page.
When I go to form view though, this new button and label do not appear.
I have changed the visible option to Always, but still nothing.
I also presume that I have to change the onclick properties from =HandleButtonClick(8)(the button I copied), to =HandleButtonClick(9) as it is a different button?
Could you also tell me how I add the new event procedure or code to make the button open a form/report, as the only thing that appears in the expression builder for the other buttons is =HandleButtonClick(8)

Any advice?

Phil
 
OK, I've figured out the steps. Change the properties of the new button and label as follows:

Button:
On Click =HandleButtonClick(9)
Name = Option9
Label:
On Click =HandleButtonClick(9)
Name = OptionLabel9

Now go into the VB code for the form.
Look for the FillOptions() subroutine, change
Const conNumButtons = 8
to
Const conNumButtons = 9

Finally, you need to make an addition in the SwitchboardItems table. Open this table, and add a new record setting the fields as follows:
SwitchboardId = 1 (assuming this is on the first switchboard)
ItemNumber = 9
ItemText = (whatever text you want to see next to the button)
Command = 3 (that tells it to open the form for browsing, if you would rather open for add-only, set this to 2)
Argument = (the name of the form you want to open)

You may need to change the size of the Switchboard to see your new button (if you maximize the form than that is not a problem).

 
Thanks JoeAtWork for this insight into how to be creative with the switchboard, it works an absolute treat, and taking this process into consideration means that any number of buttons can be added to the one switchboard - brilliant

Phil
 
Thanks for the star. The one problem is this migth make Switchboard Manager unuseable, because it's probably hard-coded to expect only 8 buttons per form (haven't tried it, though).
 
In the VB code for this form you need to update the Filloptions() sub. The variable is called conNumButtons. I have altered my switchboards to double the number of items on them. I always edit the switchboard table manually to add new menu items.
 
The good news is that it does actually work.
I currently have 12 buttons on the switchboard

Thanks again
Phil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top