Solved

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

Posted on 2013-01-28
7
1,074 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

813 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now