473,511 Members | 15,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Show custom ribbon on Print Preview

62 New Member
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
  3.  
  4. Dim i As Integer
  5. For i = 1 To CommandBars.Count
  6. CommandBars(i).Enabled = False
  7. Next i
  8.  
  9. DoCmd.ShowToolbar "Ribbon", acToolbarNo
  10. DoCmd.ShowToolbar "Menu Bar", acToolbarNo
  11. DoCmd.SelectObject acTable, , True
  12. DoCmd.RunCommand acCmdWindowHide
  13.  
  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
  4.  
  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,
Sandra

Attached Images
File Type: png ribbon.png (22.0 KB, 7218 views)
Jun 1 '12 #1
5 15249
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
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
Sandra Walsh
62 New Member
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
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
Try commenting out these two:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.ShowToolbar "Ribbon", acToolbarNo
  2. DoCmd.ShowToolbar "Menu Bar", acToolbarNo
  3.  
EDIT:
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
Sandra Walsh
62 New Member
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!
Sandra
Jun 1 '12 #5
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
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

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

Similar topics

16
11417
by: Neo Geshel | last post by:
I'm helping on a web site, and it's got our knickers in a knot. We're using the same basic CSS files (with mods) and same headers as from our other sites, but the "print preview" won't work...
2
2864
by: P | last post by:
Hi, Access 2002. I use the Print Preview toolbar when I open a report in Preview mode. I would like to configure it so it only offers the Print and Setup icons to users. I customized it on my...
1
2598
by: sea | last post by:
I have Access 2002 and I am writing this application with a custom menu bar that has a print preview button -- the start up options hide the design window. The problem is that when an open form is...
0
2003
by: John | last post by:
I have a class that creates an AxWebBrowser object in the background, loads some arbitrary html content, then shows the user a print preview. The only problem is, this print preview is a tiny...
2
14103
by: Dean Slindee | last post by:
Anybody written code in VB.NET to: 1) show a print preview window of reports already written and stored in an Access 2002 database; or 2) execute the print of a report stored in an Access 2002...
1
5683
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out...
2
9932
by: Brad Pears | last post by:
I have a vb.net 2005 application and am using the print preview screen. This screen has a printer icon on it that the user can use to print the document currently being viewed. It uses the default...
0
1326
by: jncc21 | last post by:
I'm nearly done with a site i'm building for an employer, but when i go to print preview, nothing shows like it does on the page, images are gone, and it prints all wrong. I need help with making the...
1
3069
by: mailjaneen | last post by:
Hello, can someone help me. I want to display some fields on a report in print preview (i.e. instructions), that I don't want to print to the printer or export to file. I can't seem to find any...
4
4975
by: scubasteve | last post by:
I've developed a product pricing application for a client in AC2007. They enter all the data on the one main form, then click a button to open a printable report in Print Preview. My problem...
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7417
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5659
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3219
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.