Switchboard again

  • Thread starter Thread starter Dazza
  • Start date Start date
D

Dazza

Thanks Rosco for your assistance.

I have a switchboard form that has two pages; page 1
(default) and page 2.

I need a macro or code that will open the switchboard at
page 2 and not page 1 without changing the default
settings.

Cheers,
D
 
Hi,

I'm not Rosco, but I think I can help.
I have a black belt in Switchboard Manager issues.

Are you using the built-in Access Switchboard Manager?
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,
 
Hey Jeff
Pretty clever. nice solution
Rosc

----- Jeff Conrad wrote: ----

Hi

I'm not Rosco, but I think I can help
I have a black belt in Switchboard Manager issues

Are you using the built-in Access Switchboard Manager
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 ErrorPoin

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

ExitPoint
Exit Su

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

End Su

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 Conra
Access Junki
Bend, Orego
 

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

Access Switchboard error message 1
Switchboard Questions 2
Switchboard Minimized 4
SWITCHBOARD 1
Start Switchboard 1
Switchboard problem 2
Switchboard passwords 2
I've lost my Switchboard ! 3

Back
Top