Switchboard Menu Design

B

Bob

I have the main switchboard which has other menus that can
be selected from their. And those menus may have twice as
many selections picks to them. My issue is, I would like
to set the colors selections from the sub menus other than
the main switchboard. When in design view and change the
color properties of those item picks they reference all of
the other menus.
 
J

Jeff Conrad

Hi Bob,

I'm guessing you're using the built-in Access Switchboard Manager, correct?

Well the best suggestion I can make in all seriousness is to not use the
Switchboard Manager for your situation. Don't get me wrong, I like the
Switchboard Manager and use it often, but for the type of complexity you
wish to see it may be "easier" to just create your own "Switchboard-type"
form(s) and launch all your procedures from there. The Switchboard Manager
is quick and easy and can be very useful in a lot of situations, but I can
bet ALL the experts do not use it because of it's limitations. Most just
build their own custom forms for this purpose.

Now that we got that out of the way let me at least offer a solution using
your current setup. It's not quite clear from your post exactly what "color
properties" you want to change, but let me give you some sample code that
should give you a nudge in the right direction. Please make a BACK-UP copy
of your database BEFORE proceeding in case we mess up!

There are many ways to tackle this problem, here is just one possible
solution. For this situation let's suppose you want to change the forecolor
of the individual switchboard labels on each menu and sub-menu. This code
uses the Current event of the form to see what the caption is of the
menu/sub-menus. Then it loops through all the labels and changes it to a
different color. You will of course need to adapt this to suit your own
needs.

1. Go to the code window for the Switchboard form.
2. Look for the Current event. The code should be something like this right
now:

Private Sub Form_Current()
' Update the caption and fill in the list of options.

Me.Caption = Nz(Me![ItemText], "")
FillOptions

End Sub

3. Let's change that to this (explanation later):

Private Sub Form_Current()
' Update the caption and fill in the list of options.

Me.Caption = Nz(Me![ItemText], "")
FillOptions

Dim MyInt As Integer
' Will equal number of switchboard items (8)

Select Case Me.Form.Caption

' Find out what the caption is on this menu
Case Is = "Main Switchboard"
' We're on the main one so loop through
' all labels and change forecolor to black
For MyInt = 1 To 8
Me("OptionLabel" & MyInt).ForeColor = 0
Next MyInt
Case Is = "Invoice Menu"
' We're on the invoice one so loop through
' all labels and change forecolor to green
For MyInt = 1 To 8
Me("OptionLabel" & MyInt).ForeColor = 6184448
Next MyInt
Case Is = "Vendor Menu"
' We're on the vendor one so loop through
' all labels and change forecolor to red
For MyInt = 1 To 8
Me("OptionLabel" & MyInt).ForeColor = 255
Next MyInt
Case Else
' Off chance of something weird so loop through
' all labels and change forecolor to black
For MyInt = 1 To 8
Me("OptionLabel" & MyInt).ForeColor = 0
Next MyInt
End Select

End Sub

So in this example I have the main switchboard menu and two sub-menus. The
forecolor of the labels will change depending upon which menu I'm on for
visual effect. Hopefully this should give you some ideas.

Good luck,

--Dumb St. Patrick's Day Joke--
"What do you call a fake rock in Ireland?"
..
..
..
..
"A shamrock!"

Jeff Conrad
Bend, Oregon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top