Switchboard

W

WTC

I am using the built-in Switchboard manager for the first time. I usually
create my own switchboards.

I am trying to open a switchboard to a specific switchboard (that I created
in the switchboard manager) on a form using vb code. But every time i get
the Mainswitchboard, not the one that I want.

the switchboardid is "2" that I am trying to get. The main switchboardid is
"1".

the command i am using is

stDocName = "Switchboard"

DoCmd.OpenForm stDocName, , "SwitchboardFilter001"

the query "SwitchboardFilter001" is filtering the switchboardid of 2.

any help would be appreciated.
 
J

Jeff Conrad

Hi William,

I think I can help on this one.
I have a black belt in Switchboard Manager issues.
Get rid of the query, you won't need it.

I assume you want the Switchboard to open to the "default"
menu most of the time, but in this instance you want some
way to open to the second menu. Correct?

If so, use this code launched from a command button on
another form somewhere:

Private Sub cmdOpenSwitchboard_Click()
On Error GoTo ErrorPoint

DoCmd.OpenForm "Switchboard"
Forms!Switchboard.Filter = "[ItemNumber] = 0 " _
& "And [SwitchboardID] = 2"
Forms!Switchboard.Refresh

ExitPoint:
Exit Sub

ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " _
& Err.Description, vbExclamation, _
"Unexpected Error"
Resume ExitPoint

End Sub

What this will do is open the Switchboard form, but
display the second menu. You will have to make sure that
the second menu you want to display uses SwitchboardID
number 2 in the Switchboard Items TABLE. Also, this code
assumes you haven't changed the name of the actual
Switchboard form. Adjust the code if necessary.

Hope that helps,
 
W

WTC

Thanks for the help, worked beautifully!!!

--
William

Jeff Conrad said:
Hi William,

I think I can help on this one.
I have a black belt in Switchboard Manager issues.
Get rid of the query, you won't need it.

I assume you want the Switchboard to open to the "default"
menu most of the time, but in this instance you want some
way to open to the second menu. Correct?

If so, use this code launched from a command button on
another form somewhere:

Private Sub cmdOpenSwitchboard_Click()
On Error GoTo ErrorPoint

DoCmd.OpenForm "Switchboard"
Forms!Switchboard.Filter = "[ItemNumber] = 0 " _
& "And [SwitchboardID] = 2"
Forms!Switchboard.Refresh

ExitPoint:
Exit Sub

ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " _
& Err.Description, vbExclamation, _
"Unexpected Error"
Resume ExitPoint

End Sub

What this will do is open the Switchboard form, but
display the second menu. You will have to make sure that
the second menu you want to display uses SwitchboardID
number 2 in the Switchboard Items TABLE. Also, this code
assumes you haven't changed the name of the actual
Switchboard form. Adjust the code if necessary.

Hope that helps,
--
Jeff Conrad
Access Junkie
Bend, Oregon

WTC said:
I am using the built-in Switchboard manager for the first time. I usually
create my own switchboards.

I am trying to open a switchboard to a specific switchboard (that I
created
in the switchboard manager) on a form using vb code. But every time i
get
the Mainswitchboard, not the one that I want.

the switchboardid is "2" that I am trying to get. The main switchboardid
is
"1".

the command i am using is

stDocName = "Switchboard"

DoCmd.OpenForm stDocName, , "SwitchboardFilter001"

the query "SwitchboardFilter001" is filtering the switchboardid of 2.

any help would be appreciated.
 
J

Jeff Conrad

Excellent, glad to help.

--
Jeff Conrad
Access Junkie
Bend, Oregon

WTC said:
Thanks for the help, worked beautifully!!!

--
William

Jeff Conrad said:
Hi William,

I think I can help on this one.
I have a black belt in Switchboard Manager issues.
Get rid of the query, you won't need it.

I assume you want the Switchboard to open to the "default"
menu most of the time, but in this instance you want some
way to open to the second menu. Correct?

If so, use this code launched from a command button on
another form somewhere:

Private Sub cmdOpenSwitchboard_Click()
On Error GoTo ErrorPoint

DoCmd.OpenForm "Switchboard"
Forms!Switchboard.Filter = "[ItemNumber] = 0 " _
& "And [SwitchboardID] = 2"
Forms!Switchboard.Refresh

ExitPoint:
Exit Sub

ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " _
& Err.Description, vbExclamation, _
"Unexpected Error"
Resume ExitPoint

End Sub

What this will do is open the Switchboard form, but
display the second menu. You will have to make sure that
the second menu you want to display uses SwitchboardID
number 2 in the Switchboard Items TABLE. Also, this code
assumes you haven't changed the name of the actual
Switchboard form. Adjust the code if necessary.

Hope that helps,
--
Jeff Conrad
Access Junkie
Bend, Oregon

WTC said:
I am using the built-in Switchboard manager for the first time. I usually
create my own switchboards.

I am trying to open a switchboard to a specific switchboard (that I
created
in the switchboard manager) on a form using vb code. But every time i
get
the Mainswitchboard, not the one that I want.

the switchboardid is "2" that I am trying to get. The main switchboardid
is
"1".

the command i am using is

stDocName = "Switchboard"

DoCmd.OpenForm stDocName, , "SwitchboardFilter001"

the query "SwitchboardFilter001" is filtering the switchboardid of 2.

any help would be appreciated.
 

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

Top