Disable Printing 3
By Richard Rost
2 years ago
Disable Printing in Access, Part 3: Ribbon, Backstage
In this Microsoft Access tutorial, I will show you how to restrict printing to only using a designated Print button. This is part 3 of 3. In this video, we will learn how to disable the Print Preview Ribbon tab and the File - Print tab on the Backstage.
Members
There is no extended cut, but here is the database download:
Silver Members and up get access to view Extended Cut videos, when available. Gold Members can download the files from class plus get access to the Code Vault. If you're not a member, Join Today!
Prerequisites
Recommended Courses
Keywords
TechHelp Access, Disable Printing Access,Print Preview Ribbon Tab,Disable File Print Backstage,Custom Ribbon Access,USysRibbons Table,Restrict Printing Access,Ribbon XML,Disable Control-P Access,System Objects Access,Custom UI XML,Backstage View Access,Encrypt Database Access
Intro In this video, I will show you how to disable printing in Microsoft Access reports by replacing the print preview ribbon with a custom blank ribbon, assigning it to a specific report, and modifying the backstage view to remove the File > Print option. You will also learn how to create and configure the USysRibbons system table, enter the necessary RibbonXML, and update database settings to restrict all major print methods. This is part 3.Transcript Today is part 3 and the final part of my "TechHelp" series. If you want to know how to disable print options so you can still let someone preview a report but not print it, well, go start with part 1 and watch part 2, and today is part 3.
In part one, we turned off the Control-P, so you can't press Control-P to print. In part two, we disabled the right-click menu. In the extended cut, I showed you how to only disable the right-click menu in specific objects like specific reports.
Today, we're going to cover the most pesky of the options, which is that print preview ribbon tab. All right, so we're in our database. Go to your customer form, go to orders, go to the invoice. All right. Now we've gotten rid of Control-P. All right, you can't use that. We can't right-click. This is something that we did in the extended cut. I just showed you guys how to completely disable it, but in the extended cut, we made this little guy. So if you right-click on it, it just says use the print button on the invoice form, which will put a little button over here. Okay, but we still got this. Even if we turn off all the menuing stuff, you still get this.
So how do we get rid of it? Well, the only way to get rid of this is to replace it with a custom ribbon. Okay, now there are a lot of different steps you can do. I cover customizing the ribbon in my Access Developer Level 44 class. It's pretty in-depth. But what I'm going to show you today, real simply, is how to create a blank ribbon and replace the print preview ribbon with that. It's not that hard. Let's see how to do it.
Close whatever objects you've got open. You can leave the main menu open. That's fine. The first step is to create a table to hold all of our ribbon data. It's going to be a system table. Alright, so go to create, table design, you're going to put these three fields in it: ID by itself, that's going to be your autonumber, okay; RibbonName, no space, short text, that's the name of the ribbon; and then RibbonXML, and that's a long text field. That's it, just those three things. I believe you can add more, but you have to have those three fields. I don't really know why you'd want to add more, but okay.
All right, save this as, you ready for it, USysRibbons. Just like that. Here, I'll zoom in so you can see it better. Alright, there are your fields, and that's the name of it, USysRibbons.
And I'm not sure, but I think the "Sys" has to be capitalized. Usually, it doesn't matter. Some things do matter because the ribbon stuff, some of it is case sensitive. I don't think this is though. USysRibbons. Alright? Primary key defined, you say yes, and there you go. There's your table, and there's your data, or your fields. Okay?
Alright. Alright, we're going to put some data in here. Go over to datasheet view. Okay. We're going to open this up like this, make it nice and big, make this nice and tall. You'll see why in a second. Okay, the ribbon name is going to be Print Preview. No spaces, okay. That's what you're going to put in the RibbonXML field. Again, I'll zoom in for you so you can see it better. Let's see, here's my zoom. Alright. Zoom.
Uh, Gold members, you can copy that of my database if you want to, everybody else gets typing, and if you watched my video on how to do OCR screen capture, you can do with Google now. You can just do a screen capture, then just drop in Google as an image of it, and it will OCR the text for you. But that's it, what does this saying?
Well, this is really creating a new ribbon. It's just telling you what the XML stuff is. Don't worry about it. Just don't worry about it. This says, "Give me a new ribbon and start from scratch." Now normally in here, you'd have other commands. You'd have groups and controls and labels and drop-down boxes and all kinds of stuff. This is just saying, "We're going to start a new ribbon from scratch." That's what true is, which gives you a blank new ribbon, but it's got no controls in it. So it's going to basically be a blank, empty ribbon. Okay, makes sense?
Okay, that's the simplest blank ribbon. Alright, save that, close it. Now, what you're going to do at this point is you have to restart your database. So shut it down and restart it because Access only reads that ribbon table when it loads the first time. So if you make any changes to it, you've got to shut down and restart Access, which I think is a pain. But you got to do what you got to do.
Now when the database is back open, notice. You're not gonna see your table. Why? Because it's a system table; normally, system tables don't show up in here.
So right-click up here, go to navigation options, and you can turn on Show System Objects. Alright, there's a whole bunch of 'em, don't touch this stuff, don't touch it. But look, there's USysRibbons. So if you have to get back in here to modify it, there it is, alright. But I'm going to leave this stuff off because it just clutters things. I don't like to look at it all the time. Okay, there are hidden objects, and there are system objects. I usually leave hidden objects on because I like to see sometimes when I hide stuff and then I go try to find it later, I'm like, "Where did I put it?" But I don't need to see the system objects. But it's in there, and Access now has loaded up that custom ribbon called Print Preview.
But we still have to assign it to the report. See, this guy still comes up. So what you're going to do is, I can't even right-click on this, I turned off the right-click menu. Okay, alright. We got to come in through the navigation pane, right-click, design view, open up the properties for the report, come over here to Other, and find Ribbon Name. Drop that down, and there's Print Preview. Okay, save it, close it, close it, close it, all right, open it back up again, and now there you go. The print preview ribbon is now hidden.
Now we're still not out of the woods just yet, even though we turned off the custom ribbon just for this guy. The user can still go to one more place to print this thing. That's File > Print, and it's right there. So we have to turn that off too. Okay, now this is a special part of the ribbon called the backstage. It's under File. What we can do is we can modify the backstage by taking Print off of here, but unfortunately, this is going to be for the entire database. But like I said, there are other ways that you can give your user the ability to print. But in order to turn that off, it's got to be at the database level. Okay?
How do we do that? Well, we have to make one more modification to our custom ribbon. So let's turn back on the system objects. Alright. Go back into your USysRibbons. We're going to make another ribbon in here. We're going to call it Backstage. Alright. Let me give you the code for it. Let me copy it. I got it on my clipboard here. I had to play with this for a while to get it working.
There it is, alright, there it is right there. Let me zoom in so you can see it better. Very similar to the other one. Alright, you got the custom UI, all this stuff here. You got "ribbon start from scratch" is false for this one because we want to use the rest of what's on the File backstage, okay? But we just want to modify this guy.
ID MST abPrint means I want to make the print tab invisible. That's what this does. Hit okay. We've got a second custom ribbon in here now. Close this. Close down the database because it has to reload it again. Open her up. Okay, now you're still going to see it under File > Print because we haven't assigned it yet. So go to options, current database, scroll down, and this thing right here, Ribbon Name. Drop that down and pick your backstage ribbon now. Okay, hit okay, restart the database again,
and now this time when it opens up, now you will see File, no Print. Look at that.
So now we've got our form, our report right here. No ribbon print preview tab. No option for File > Print, okay, and no Control-P, and no right click. So now, the only way the user is going to print this is if they screenshot it. They can literally zoom in and use a screen capture tool. That's it. They cannot print this any way that I know of unless I'm missing something. I've been doing this forever. This is the only four ways I can think of to print this.
So what you need to do now is make them their own print button here. So after they preview it, click on this one, and then it will print it. And that's it. Now of course, there is the quick access toolbar across the top. You want to turn that off too. But that's easy.
Okay, there you go. So there's your three-part series. How to disable printing. We've disabled it from the keyboard, we've disabled it from the right-click shortcut menu, we've disabled it from the ribbon, and also part of the ribbon is the backstage, the File > Print. So there are four different ways that you can print something. There you go.
That was my day, putting all that together. Like I said, this ribbon stuff is not easy, but I go over it in a lot more detail from the ground up. All that stuff that I just said, "Here's the code, don't worry about it," well, I explain it fully in my "TechHelp" series so you understand what it all is. We go through the XML and what each of these objects are. So check that out if you want to learn more about customizing the ribbon, customizing the backstage view, customizing the right-click pop-up menus, all that stuff.
And again, if you want to learn more about securing your database, you can control what users can do, what in the database to do, user log on to setup groups, we create a system log, I show you how to encrypt the database, all that stuff that's all covered in my Security Seminar. But there you go, that is going to be your "TechHelp" video for today. I hope you learn something. Live long and prosper, my friends. I'll see you next time.
TOPICS Creating a blank custom ribbon in Access Creating a system table to store ribbon data Configuring RibbonName and RibbonXML fields in a table Using USysRibbons system table in Access Creating a simple blank ribbon through RibbonXML Restarting Access to load custom ribbon changes Access navigation options and showing system objects Assigning a custom ribbon to a specific report Disabling File > Print from the backstage view Modifying the backstage view in Access with custom XML Securing a database to limit print functionalities Adding a user-specific print button on an Access form Explanation of Access ribbon and backstage view customization Controlling user permissions and database security in AccessQuiz Q1. What is the first step mentioned in the video to begin creating a custom ribbon? A. Design a new form B. Create a new report C. Start Access in safe mode D. Create a system table to store ribbon data
Q2. In the video, which name is given for the table that holds the ribbon data? A. RibbonDataTable B. RibbonSettings C. USysRibbons D. RibbonInfo
Q3. Which field is NOT one of the three mentioned that must be included in the system table for the ribbon? A. ID B. RibbonName C. RibbonDescription D. RibbonXML
Q4. Why do you need to restart Access after creating or modifying the USysRibbons table? A. To trigger a backup of the database B. To refresh the relationship window C. Because Access only reads the ribbon table when it loads the first time D. To reset the Access security settings
Q5. How did the video suggest you could disable the ribbon that appears in print preview? A. By setting the Ribbon's visible property to 'false' B. By creating a custom ribbon with no controls C. By removing the report from the database D. By enabling the "Allow Ribbon Print" setting
Q6. What must you do to modify the backstage view and remove the Print option? A. Edit the properties of the File tab B. Create a custom form C. Make another modification to the USysRibbons D. Disable all shortcuts in Access Options
Q7. What was the purpose of assigning a custom ribbon named 'Print Preview' in the report's properties? A. To create a new default print setting B. To allow the user to select different print options C. To replace the default print preview ribbon with a custom blank one D. To enhance the visual design of the print preview
Q8. What additional UI element was mentioned in the video that should be turned off to prevent printing? A. The Quick Access Toolbar B. The Status Bar C. The Navigation Pane D. The Formula Bar
Q9. According to the video, the backstage area of Access can be modified by adjusting which elements? A. Navigation options B. XML code for custom ribbons C. Access macro settings D. Database documenter
Q10. What is NOT a reason for creating a user-specific print button on an Access form as described in the video? A. To have a record of who printed the report B. To control the way printing is done in the database C. To charge users for each print they make D. To provide a specific method to print after previewing
Answers: 1-D; 2-C; 3-C; 4-C; 5-B; 6-C; 7-C; 8-A; 9-B; 10-C.
DISCLAIMER: Quiz questions are AI generated. If you find any that are wrong, don't make sense, or aren't related to the video topic at hand, then please post a comment and let me know. Thanks.Summary Today's TechHelp tutorial from Access Learning Zone wraps up my three-part series on disabling print options in Microsoft Access, while still giving users the ability to preview reports. If you have not watched the previous two parts, I recommend going back to part one and part two for a full understanding of the entire process.
In the first part, we handled disabling the Control-P shortcut to prevent users from printing via the keyboard. The second part focused on removing the right-click context menu, so users could not access print options that way. In the extended cut of part two, I explained how you can target specific objects—like certain reports—to selectively disable the right-click menu.
Today, I want to tackle the last major hurdle: hiding the Print Preview ribbon tab. Even if everything else has been disabled, users can still print if this tab is accessible during report previews. So, let me walk you through the process to eliminate that possibility.
First, you will need to create a system table to hold your custom ribbon details. Begin by creating a new table in design view with three specific fields: an ID field set as an autonumber, a RibbonName field (short text, with no spaces), and a RibbonXML field set as long text. Save this table with the name USysRibbons. It is important to use this exact name, though the capitalization of "Sys" likely does not matter here. Make sure your ID field is set as the primary key.
Once your table structure is ready, switch over to datasheet view and add a new record. For the RibbonName field, use "Print Preview" (no spaces). In the RibbonXML field, you will enter the specific XML that defines your custom ribbon—in this case, you want XML that creates a blank ribbon. The details of the XML are not important to memorize right now; just be aware that its purpose is to give you an empty ribbon with no print options available.
After saving and closing the table, you must restart your database. Access only reads the ribbon definitions from the USysRibbons table when the application loads, so you have to close and reopen Access for any changes to take effect. If you try to look for the table afterwards, you will not see it right away because it is a system table. If you ever need to revisit USysRibbons, you can enable system objects from the Navigation Pane options, but generally you might want to leave this off to keep things tidy.
Now, to apply the ribbon to your report, go to the report's property sheet (in design view), look under the "Other" tab, and find the Ribbon Name property. Set this to "Print Preview"—the custom ribbon you just defined. Save and close the report, then reopen it. You will see that the Print Preview ribbon tab is now gone.
At this point, you have removed most print options, but there is still one last place where printing can happen: the File > Print (the backstage area). To address this, you need to modify the backstage by introducing another custom ribbon entry. Head back to USysRibbons through system objects, and insert a new record. This time, the RibbonName could be something like "Backstage." For the RibbonXML, you need XML that hides the print option specifically from the backstage area. In this custom XML, you set the backstage Print tab to be invisible. Note that this change will apply to the entire database, not just individual reports.
Save your changes, close Access again, and reopen it so the new ribbon is loaded. To assign this backstage ribbon at the database level, go into Access Options, under "Current Database," and set the Ribbon Name property to your new "Backstage" ribbon. After restarting Access once more, you will discover that File > Print is no longer visible either.
With these steps completed, you have effectively blocked printing through Control-P, the right-click context menu, the Print Preview ribbon, and the backstage File > Print area. At this point, the only way a user might copy your report information is by taking a screenshot, which is a limitation you cannot easily prevent within Access itself.
For users who still need to print under certain conditions, I recommend providing a controlled print button on your form. This lets you manage exactly when and how users can print reports.
In summary, through this three-part series, I have guided you on disabling print functionality in four critical areas: keyboard shortcuts, right-click menus, ribbon tabs, and the backstage view. The customization of ribbons and backstage options may be advanced topics, but I go over them in much more detail—explaining all the XML and object settings—in my full Access Developer classes.
If you are interested in database security, user permissions, setting up group logins, tracking activity, or encrypting your database, I cover these in depth in my Security Seminar as well.
You can find a complete video tutorial with step-by-step instructions on everything discussed here on my website at the link below. Live long and prosper, my friends.Topic List Creating a blank custom ribbon in Access Creating a system table to store ribbon data Configuring RibbonName and RibbonXML fields in a table Using the USysRibbons system table in Access Creating a simple blank ribbon with RibbonXML Restarting Access to load custom ribbon changes Access navigation options and showing system objects Assigning a custom ribbon to a specific report Disabling File Print from the backstage view Modifying the backstage view in Access with custom XML Adding a user-specific print button to a form
|