HELP: Switchboard Menu Buttons

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

ACCESS 2000

I have a switchboard that has serveral menus and sub-menus and I am finding
it very excessive to keep making a MAIN MENU button.

I have made a blank COMMAND BUTTON to take me back to the MAIN SWITCHBOARD
MENU, but I do not know what coding to put in the ON CLICK procedure.
 
ACCESS 2000

I have a switchboard that has serveral menus and sub-menus and I am finding
it very excessive to keep making a MAIN MENU button.

I have made a blank COMMAND BUTTON to take me back to the MAIN SWITCHBOARD
MENU, but I do not know what coding to put in the ON CLICK procedure.

Are you using the built-in Switchboard Manager?
 
Yes, I used the switchboard manager under DATABASE UTILITIES

Ok, put this code behind that command button.
I called mine cmdOpenMainMenu.

'*********Code Start**************
Private Sub cmdOpenMainMenu_Click()
On Error GoTo ErrorPoint

Forms!Switchboard.Filter = "[ItemNumber] = 0 " _
& "And [SwitchboardID] = 1"
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
'*********Code End**************

What this will do is change the filter on the form to
show the main menu. You will have to make sure that
the main menu you want to display uses SwitchboardID
number 1 in the Switchboard Items TABLE. If it is a
different number, then adjust the code accordingly.
Also, this code assumes you haven't changed the name
of the actual Switchboard form. Adjust the code if necessary.

Hope that helps,
 
PERFECT

Jeff Conrad said:
Yes, I used the switchboard manager under DATABASE UTILITIES

Ok, put this code behind that command button.
I called mine cmdOpenMainMenu.

'*********Code Start**************
Private Sub cmdOpenMainMenu_Click()
On Error GoTo ErrorPoint

Forms!Switchboard.Filter = "[ItemNumber] = 0 " _
& "And [SwitchboardID] = 1"
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
'*********Code End**************

What this will do is change the filter on the form to
show the main menu. You will have to make sure that
the main menu you want to display uses SwitchboardID
number 1 in the Switchboard Items TABLE. If it is a
different number, then adjust the code accordingly.
Also, this code assumes you haven't changed the name
of the actual Switchboard form. Adjust the code if necessary.

Hope that helps,
 
Jeff if you don't mind I have another question...

On my switchboard I have 3 standard Command Buttons: MAIN MENU, CLOSE
SWITCHBOARD, EXIT ACCESS. The questions I have concerns the CLOSE
SWITCHBOARD button which closes the switchboard form but not ACCESS.

My database has multiple users with various levels of access, the purpose of
the button would allow top level users to close the switchboard and go into
the database itself to make modifications.

Here is what I need to accomplish:
1. When one presses the CLOSE SWITCHBOARD button it would open the database
window only for top level users, all other users would get an error message
saying: "Access Denied"
2. When I "X" the switchboard (no matter what user I am using) Access is
still open and all I have to do is press FILE and the #1 entry on the
Recently Used File list and I am back into the database window. What code do
I need to put in that would bring up the LOGON window and not the Database
Window?
 
Jeff if you don't mind I have another question...

On my switchboard I have 3 standard Command Buttons: MAIN MENU, CLOSE
SWITCHBOARD, EXIT ACCESS. The questions I have concerns the CLOSE
SWITCHBOARD button which closes the switchboard form but not ACCESS.

My database has multiple users with various levels of access, the purpose of
the button would allow top level users to close the switchboard and go into
the database itself to make modifications.

Here is what I need to accomplish:
1. When one presses the CLOSE SWITCHBOARD button it would open the database
window only for top level users, all other users would get an error message
saying: "Access Denied"
2. When I "X" the switchboard (no matter what user I am using) Access is
still open and all I have to do is press FILE and the #1 entry on the
Recently Used File list and I am back into the database window. What code do
I need to put in that would bring up the LOGON window and not the Database
Window?

Hi Tim,

Before I can even begin to offer some suggestions, I will need the answer
to the following questions:

1. Which Access version are you using? 2000 I think??

2. You mentioned various levels of access. Have you implemented User
Level Security or are you using some kind of home-grown security
system you created? If the latter, can you give some details about it?

3. You said you created three command buttons, but it is not entirely
clear whether these are options you used through the wizard or these
are separate command buttons that you created and placed on the form
yourself. So which is it?
 
Wild stab in the dark....

Is your new label "attached" to any other control - a parent control like another text box or
command button?

An attached label does not fire a mouseover event (Down, Up, Move) by itself - only the parent's
mouseover events fire.

- Select the label
- Cut it to place it on the Clipboard
- Paste it back onto the form grid so it retains all its properties, but is now not attached to any
controls
- Reposition it back where you want
- Assign a mouseover event (Down, Up, or Move)
- Save the form
- Open in regular view and test it out

You should be good to go.
--
Jeff Conrad
Access Junkie - MVP
http://home.bendbroadband.com/conradsystems/accessjunkie.html
Access 2007 Info: http://www.AccessJunkie.com

in message:
 

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

Command Button not working 1
Linking Switchboard button to a .doc file 2
Access Switchboard error message 1
Switchboard Form 3
Switchboard and Closing Forms 4
Switchboard Error 2
Access Switchboard 1
Switchboard Menu Title 1

Back
Top