Solved

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

Posted on 2013-01-28
7
1,083 Views
Last Modified: 2013-01-28
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
0
Comment
Question by:andrewpiconnect
  • 4
  • 3
7 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 38826530
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.
0
 

Author Comment

by:andrewpiconnect
ID: 38826595
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?
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 38826655
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.
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

Author Comment

by:andrewpiconnect
ID: 38826739
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
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 38826783
You only need one subform for all of the stuff on the right, give the subform control a name of something like "sub_Main"

Then, you would use:

me.parent.sub_Main.SourceObject = "frmCustomers"
me.parent.sub_Main.Visible = true

and

me.parent.sub_Main.sourceobject = "frmAppointments"
me.parent.sub_Main.visible = true

Actually, now that I think about it, why do you even need a subform for the switchboard controls?  Why not just put them on the main form?  If you need to, you could add a vertical line to set off the switchboard from the subform.  If you get rid of the "switchboard" subform, that syntax would be:

me.sub_Main.SourceObject = "frmCustomers"
me.sub_Main.Visibile = true
0
 

Author Comment

by:andrewpiconnect
ID: 38827149
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
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 38827277
glad to be of assistance.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question