Solved

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

Posted on 2013-01-28
7
1,053 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

744 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

15 Experts available now in Live!

Get 1:1 Help Now