By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,122 Members | 921 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,122 IT Pros & Developers. It's quick & easy.

Show custom ribbon on Print Preview

P: 62
Hello -

I am working in Access 2010.

I am trying to show a custom ribbon when a report is opened in Print Preview mode.

I have created a custom ribbon called Print and Send. This ribbon shows only 4 options. (see image)

The report is opened from a Reports Dashboard that hides all the ribbons and windows using the following On Load event:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. 'Hide the menus and Objects
  4. Dim i As Integer
  5. For i = 1 To CommandBars.Count
  6. CommandBars(i).Enabled = False
  7. Next i
  9. DoCmd.ShowToolbar "Ribbon", acToolbarNo
  10. DoCmd.ShowToolbar "Menu Bar", acToolbarNo
  11. DoCmd.SelectObject acTable, , True
  12. DoCmd.RunCommand acCmdWindowHide
  14. End Sub
The Event to open the report is as follows:
Expand|Select|Wrap|Line Numbers
  1. Private Sub PipelineReportBtn_Click()
  2.  DoCmd.OpenReport "r_PipelineReport", acViewPreview, , , acWindowNormal
  3.  DoCmd.ShowToolbar "Print and Send", acToolbarYes
  5. End Sub
When I open the report, I get the error saying that the database cannot find the Print and Send toolbar.

In the Report Design, there are no options available in the dropdown for Ribbon Name, Toolbar or Menu bar. properties.

In the Current Database Options window, there are no options available in the dropdown for Ribbon Name. Allow Full Menus and Allow Default Shortcut Menus options are both checked.

I would appreciate any insight regarding how to make this custom menu accessible.

Many thanks,

Attached Images
File Type: png ribbon.png (22.0 KB, 6079 views)
Jun 1 '12 #1
Share this Question
Share on Google+
5 Replies

Expert Mod 100+
P: 2,321
Open your report in design view, and for the report properties, select the "Other" tab, and fill in the "Ribbon Name" property with the name of your custom ribbon. Then it should show itself when you print preview the report.

I am unsure whether any of your existing code might prevent the ribbon from showing. Please report back your observations on the matter.
Jun 1 '12 #2

P: 62
Hey there -

I had tried that without success. The ribbon names do not show up in the dropdown options for that property. I tried typing in the name with no luck.

PS- I rem'd out the following code for this test.
Expand|Select|Wrap|Line Numbers
  1. DoCmd.ShowToolbar "Print and Send", acToolbarYes
Jun 1 '12 #3

Expert Mod 100+
P: 2,321
Try commenting out these two:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.ShowToolbar "Ribbon", acToolbarNo
  2. DoCmd.ShowToolbar "Menu Bar", acToolbarNo
If the ribbon names are not showing up as a dropdown for the property it is because they are not created correctly. When you say you, you have created the ribbons, HOW exactly did you create them?
Jun 1 '12 #4

P: 62
The lines you are asking me to commnet out are on the dashboard, not the report. I want to hide all the menus and ribbons for the user when they open the database.

However, I want to give them access to some options on the Print Preview ribbon when they open a report (WITHOUT showing the FILE tab), hence the custom ribbon.

I created the custom ribbon via Customize the Ribbon per the attached image.

Thanks for helping me sort this out!
Jun 1 '12 #5

Expert Mod 100+
P: 2,321
Yes, I realise they are on the dashboard.

I haven't "dealt" with you before or on the forum, or at least not to such a degree that I have taken notice.
Its a sad experience from online forums that if I give out 5 detailed instructions, only 3 of them are followed (and the user doesn't properly report back which of the 3 he/she followed. Therefore with new(er) members I usually take a slower approach with fewer test instructions per post.

Now in your specific case, the reasons I wanted you to try commenting out the lines were to follow a certain debug process trying best as possible to ascertain what exactly your settings are, since I can't see your computer nor code.

I missed your original attached image, therefore I didn't spot it right away. Your "ribbon" is not a ribbon, it is a tab in a ribbon.

You will need to create a table to store ribbon xml and load it at startup, if you want to achieve your goal. I can try to find a few resources for you, if interested, but I would say it does require a certain degree of experience to implement.
Jun 4 '12 #6

Post your reply

Sign in to post your reply or Sign up for a free account.