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

A97: Switchboard 2

Status
Not open for further replies.

RonMcIntire

Technical User
Oct 12, 2002
166
0
0
US
Anyone know how I can change the Switchboard banner programmatically to reflect the Label of the switchboard button?

Example:
I have a main switchboard called "CSD Directory"
with the following buttons:

• Get Data
• Society Section
• District Section
• Chapter Section
• Awards and History
• Email Directory
• Exit

I would like for the switchboard to display the banner "Society Section" if I press the Society Section button.

Thanks,

Ron
 
Hi,

I think you need to add some more switchboards, which are opened when you press one of the section buttons.

Regards

Garry
 
Hi you could look at my FAQ, and this may help, I haven't looked into linking it to button click but its probably possible

hope this helps Rob! [Bigcheeks]
Process and Procedure are the last hiding place of people without the wit
and wisdom to do their job properly.
 
You can do it with some minor changes to the code behind the Switchboard form. Let me know if you're interested in the code changes.
 
TCVance:

Thanks for your response. Yes, I am interested in looking at the code changes to change the title of the switchboard.

Ron Mc
 
Sorry I forgot to put a link to my FAQ

faq181-2720

Rob! [Bigcheeks]
Process and Procedure are the last hiding place of people without the wit
and wisdom to do their job properly.
 
I didn't know if you was still needing this code or not. Here it is anyway.

You need to make a label in the switchboard where you want the menu title to be and name it "OptionLabel0". Then change the "FillOptions" sub routine in switchboard code. Following is part of the routine and the changes.

' Open the table of Switchboard Items, and find
' the first item for this Switchboard Page.
Set dbs = CurrentDb()
strSQL = "SELECT * FROM [Switchboard Items]"
'strSQL = strSQL & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" & Me![SwitchboardID]
***strSQL = strSQL & " WHERE [SwitchboardID]=" & Me![SwitchboardID]
strSQL = strSQL & " ORDER BY [ItemNumber];"
Set rst = dbs.OpenRecordset(strSQL)

' If there are no options for this Switchboard Page,
' display a message. Otherwise, fill the page with the items.
If (rst.EOF) Then
Me![OptionLabel1].Caption = "There are no items for this switchboard page"
Else
***Me("OptionLabel0").Caption = rst![ItemText]
rst.MoveNext
While (Not (rst.EOF))
Me("Option" & rst![ItemNumber]).Visible = True
Me("OptionLabel" & rst![ItemNumber]).Visible = True
Me("OptionLabel" & rst![ItemNumber]).Caption = rst![ItemText]
rst.MoveNext
Wend
End If


The 2 lines of code with "***" at the beginning are the 2 lines of code that I have changed.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top