Link to home
Start Free TrialLog in
Avatar of andrewpiconnect
andrewpiconnectFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Access 2007 switchboard as a menu bar/navigation pane on left hand side

Hi,

I am developing a new system and would ideally like the switchboard to always be visible on the left hand side of the screen (about 4cm wide and cover from top to bottom).

When a new form is opened I would like this to open alongside the switchboard, NOT over the top of it, so the switchboard is still visible. The idea is for the user to be able to see all the buttons on the switchboard no matter what form they have opened so that they can open/close all the forms on the switchboard menu with ease.

As an extra, I intend to put code behind each button on the switchboard so that if a user has one form open and clicks a button to open another form it will close the currently open form first.

Is this possible in Access 2007?

Many thanks
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

If you want to do this, your best bet would be to create a main form, then put your "switchboard" as a subform along the left side, and another subform on the right, to display the other forms you want to display.
Avatar of andrewpiconnect

ASKER

Hi,

Ive created a "Main Form", put a "Switchboard" as a subform on the left hand side with 2 buttons (to open 2 different forms) but how do i get the switchboard to open these 2 new forms as subforms within the main form?
Create the 2nd subform (we will call this sub_Main) on the main form, but don't assign it a SourceObject, probably set it's visible property to No (to prevent the user from seeing a big white block on the right side of the main form.

Then, when the user clicks one of the buttons in your "switchboard", set the SourceObject of the 2nd subform to the name of the form you want to use and set the visible property of the subform to Yes.

Private Sub cmd_Form1_Click

    me.parent.sub_Main.SourceObject = "frm_Form1"
    me.parent.sub_Main.visible = true

End Sub

You might want to consider using toggle buttons on your switchboard, and put them in a option group, so that only one one button can be "depressed" at a time, and to make it easier for your user to know which "form" they are currently using.
Here's what i have so far.

Entire Screen Form = frmSWBMain
Menu buttons form = frmSWBMenuSub

2 x different subforms i want to load are:
frmCustomers
frmAppointments

The below code seems to work fine and produce the desired results although I am a little miffed as to whether I have set the SourceObject correctly. Can you please check?

PS. I have set the frmAppointments to show by default when frmSWBMain is opened.

Private Sub cmdButton1_Click()
   
    Me.Parent.frmCustomers.SourceObject = "frmCustomers"
    Me.Parent.frmCustomers.Visible = True
    Me.Parent.frmAppointments.Visible = False
   
End Sub

Private Sub cmdButton2_Click()
   
    Me.Parent.frmAppointments.Visible = True
    Me.Parent.frmCustomers.Visible = False
   
End Sub
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Excellent stuff. Many many thanks.

I have taken your advice and used a single form (no subform for the swichtboard controls) and put the frmCustomers & frmAppointments into the main form.

Syntax used (as it may be helpful for others is:

Private Sub Toggle22_GotFocus()
   
    Me.sub_Main.SourceObject = "frmCustomers"
    Me.sub_Main.Visible = True
   
End Sub

Private Sub Toggle23_GotFocus()
   
    Me.sub_Main.SourceObject = "frmAppointments"
    Me.sub_Main.Visible = True
   
End Sub

Thanks again
glad to be of assistance.