Switchboard Button to Open Sub-switchboard buttons

legalhustler

Well-known Member
Joined
Jun 5, 2014
Messages
1,160
Office Version
  1. 365
Platform
  1. Windows
I think there is a simple answer to this, but my brain is just not functioning right now.

I created a switchboard form in Design View. I want to create a button called Reports. When the user clicks it, it should have a button for Report 1, button for Report 2, button for Report 3, etc. How can I make this happen?
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
In the most simplest way, put this bit of code behind your 'Reports' button;

Code:
DoCmd.OpenForm "frmReports", acNormal, "", "", , acNormal

This assumes you have another form called 'frmReports' which has the report specific buttons you mentioned.

Or;

Create your 'frmReports' first and when you place a new button on the switchboard, follow the wizard to open a form and choose the 'frmReports'

HTH
Colin
 
Upvote 0
In the most simplest way, put this bit of code behind your 'Reports' button;

Code:
DoCmd.OpenForm "frmReports", acNormal, "", "", , acNormal

This assumes you have another form called 'frmReports' which has the report specific buttons you mentioned.

Or;

Create your 'frmReports' first and when you place a new button on the switchboard, follow the wizard to open a form and choose the 'frmReports'

HTH
Colin

Sorry, let me clarify. I have 7 reports (let's call it Report1, Report2, Report3, etc). I only have a switchboard button called "Reports" and that's it. There are no forms that I'm dealing with. I just want the "Reports" button to open a sub-page with sub-buttons for Report1, Report2, Report3, etc. Therefore, for instance when I click Report1 it simply opens the report I need to view/print.

Do I need to create buttons for Report1, Report2, Report3, etc and set it to invisible? When I click the "Reports" button it should then show me a page with 7 report buttons for me to choose.

Also, I am not sure why I need another form called 'frmReports' as you mentioned.
 
Last edited:
Upvote 0
Nevermind about the last point I brought up. Yeah, I guess I can have another form with all 7 reports and reference it using the code you provided, however this will open another Form tab to open, which I really don't like. Anyway to set the 7 report sub-buttons in the same switchboard form so that when I click "Reports" it doesn't open another form tab?
 
Upvote 0
On the switchboards 'On Load' event you can set your report buttons to invisible

Code:
Private Sub Form_Load()

Me.Report1.Visible = False
Me.Report2.Visible = False
Me.Report3.Visible = False
Me.Report4.Visible = False
etc...

End Sub

So the code for your 'Report' buttton's click event will be;

Code:
Private Sub Reports_Click()

Me.Report1.Visible = True
Me.Report2.Visible = True
Me.Report3.Visible = True
Me.Report4.Visible = True
etc...

End Sub

Or, are you asking to view the reports using a control on the switchboard without the usual preview window opening?

HTH
Colin
 
Upvote 0
Why not have a combobox that lists the reports?

Then when the user clicks the Reports button the report they have selected in the combobox is opened.
 
Upvote 0
On the switchboards 'On Load' event you can set your report buttons to invisible

Code:
Private Sub Form_Load()

Me.Report1.Visible = False
Me.Report2.Visible = False
Me.Report3.Visible = False
Me.Report4.Visible = False
etc...

End Sub

So the code for your 'Report' buttton's click event will be;

Code:
Private Sub Reports_Click()

Me.Report1.Visible = True
Me.Report2.Visible = True
Me.Report3.Visible = True
Me.Report4.Visible = True
etc...

End Sub

Or, are you asking to view the reports using a control on the switchboard without the usual preview window opening?

HTH
Colin

You can also set the report buttons to invisible by going to each buttons property and selecting Visible to "No". This was just an idea to perhaps get all 7 buttons to show on the same page using a code or something. All I need is a button that says "Reports" and when you click it then displays 7 other buttons. I think I can do it using the Switchboard wizard but I wanted to create the switchboard using a blank form.
 
Upvote 0
Why not have a combobox that lists the reports?

Then when the user clicks the Reports button the report they have selected in the combobox is opened.

That's a good idea but I have other buttons on my switchboard so I wanted to keep it consistent. If there is no solution I guess this will be my next option or use the switchboard wizard bc I have seen it done using that. Only reason I don't want to use that is bc the Access switchboard diplaysl looks outdated so I want to customize my own switchboard.
 
Upvote 0
What other buttons do you have on the switchboard?
 
Upvote 0

Forum statistics

Threads
1,213,495
Messages
6,113,992
Members
448,538
Latest member
alex78

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top