| | |
|
|
|
Switchboard again |
| message from Dazza on 25 May 2004 |
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
|
| Jeff Conrad replied to Dazza on 25 May 2004 |
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,
|
| =?Utf-8?B?Um9zY28=?= replied to Jeff Conrad on 26 May 2004 |
Hey Jeff,
Pretty clever. nice solution.
Rosco
|
|
Archived message: Switchboard again (Microsoft Access)