Switchboard - Call Switchboard from VBA code?

LarryB

Registered User.
Local time
Today, 16:39
Joined
Jun 19, 2012
Messages
66
Hi all,

Can I call a specific switchboard page from VBA?

I can open the default switchboard form itself using code docmd.openform "switchboard"

The switchboard page I am trying to open has a switchboardid = 2

and I have trIed to use this condition in the code

DoCmd.OpenForm "Switchboard", , , "[SwitchBoardID]=" & 2

but is still opens the default page

Any ideas? If not I'll use a series of forms rather then switchboard to do what I want

Cheers

LarryB
 
RESOLVED - Switchboard - Call Switchboard from VBA code?

I got this working using the following code

[Forms]!Switchboard.Filter = "[ItemNumber] = 0 AND [SwitchboardID] = 2"

Note the main switchboard needs to be open before using the code.

This code was input in code module as a public function

Public Function SwitchBoardPageChange()
[Forms]!Switchboard.Filter = "[ItemNumber] = 0 AND [SwitchboardID] = 2"
End Function

The function could not be called directly using switchboard manager, so in I called a macro and in turn called the function

The reason for this is I want to password protect a button on the main menu.

I will put that code in now and if the password is correct it will open the admin menu using the code above

Cheers

LarryB
 

Users who are viewing this thread

Back
Top Bottom