Modified Switchboard; Hit a Snag

TastyWheat

Registered User.
Local time
Today, 02:30
Joined
Dec 14, 2005
Messages
125
I tried to make a modified version of the standard switchboard. Instead of clicking an option (that opens a new switchboard) and the list refreshing, I wanted to have the main options on one side and the sub options appear on the other side. So if "Option 1" is pressed it would show a certain set of sub options and "Option 2" would show a different subset and so on. I'm using the given Private Function HandleButtonClick(intBtn As Integer) but I'm not getting desirable results from intBtn. If I clicked on either "Work Orders" or "Add a Work Order" then intBtn is 1. Currently they are named "Option1" and "SubOption11". Does anyone know how the value of intBtn is decided?

Most of my code works fine. I just need to know which item and which group is being selected. See the picture for a clearer, umm, picture.
 

Attachments

  • switchboard.jpg
    switchboard.jpg
    23 KB · Views: 201
Just create all the buttons necessary and if button one is clicked (option 1) then you use the on_click event to show the related sub_option buttons and you hide all the other buttons.

Me.buttonOption11.Visible = False 'hides button

This could be a possible way to go.
 
Looking at table.jpg you can see that each SwitchboardID is a group, each ItemNumber greater than zero corresponds to a command, etc. This is the way the switchboard is setup if you use the switchboard editor. My table was setup fine, I just didn't setup the command buttons correctly.

The function HandleButtonClick (intBtn As Integer) gets its variable from each button. So "Option1" would send the number 1 to the button handler. This is not found under the Option1_Click() method, which is why I had so much trouble. The value is sent via the command button properties. This is shown in properties.jpg.
 

Attachments

  • table.jpg
    table.jpg
    26.5 KB · Views: 182
  • properties.jpg
    properties.jpg
    16.6 KB · Views: 183

Users who are viewing this thread

Back
Top Bottom