Showtoolbar Macro

Dartagnan

Active Member
Joined
Jun 19, 2002
Messages
386
According to the msdn microsoft site you can
"If you want to show a particular toolbar on just one form or report, you can set the OnActivate property of the form or report to the name of a macro that contains a ShowToolbar action to show the toolbar."

When I look through the various macro commands available I do not see showtoolbar available.

My goal is to show only the print preview ribbon when a user opens a report. I have already closed the ribbons using docmd.showtoolbar "ribbon", actoolbarno. For some reason docmd.showtoolbar "print preview", actoolbaryes", in the code, will not open the print preview ribbon.

Any thoughts.

Thank you in advance.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Open the form in Design view and go to its Properties. In either the All or the Other tab, you will see the Toolbar property. Pick your custom toolbar from the drop-down list, and it should display when the form is active.

Denis
 
Upvote 0
No luck. I don't see my custom toolbar.

Recap:
In my report On Load event I run docmd.showtoolbar, actoolbarno.

In Properties / Other I selected my custom toolbar in the Toolbar option.
 
Upvote 0
If you are in 2007, toolbars don't work; you need to have a ribbon / tab that you can set up to display when the form shows. To select a ribbon, use the Ribbon Name property of the form / report. To build the ribbon, download a ribbon creator. The free version lets you build a limited number of buttons and groups.

Denis
 
Upvote 0
If you have a custom ribbon, you can assign it to the form but you must use the Ribbon property, not the Toolbar property.

Denis
 
Upvote 0
I am certain I am missing something. For security I have hidden the database window, the navigation pane and all ribbons. However, I need the print ribbon to open when a user opens a report.
In 2003 I accomplished this with the following code:
'SHOW THE CUSTOM REPORTS TOOLBAR
For i = 1 To CommandBars.Count
If CommandBars(i).name = "al toolbar" Then
CommandBars(i).Enabled = True
CommandBars(i).Visible = True
End If
Next i

In 2010 I have a custom ribbon, but can't get the ribbon to open when the report opens. I have tried code and I have tried using the ribbon property found on the Other tab.
 
Upvote 0

Forum statistics

Threads
1,224,561
Messages
6,179,522
Members
452,923
Latest member
JackiG

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