Add a Print Command button on a report that is viewed in Print Preview (1 Viewer)

anski

Registered User.
Local time
Tomorrow, 07:36
Joined
Sep 5, 2009
Messages
93
I have disabled the following in Access Options: Navigation Pane, Allow Full Menus, Allow Default Shortcut Menus. I do not want users to have access to commands and right-click options.

I have a report that opens in Print Preview. Users want to be able to see the look of the report first before printing the report. (If margins are ok, if there are no blank pages, etc.) Since I have disabled all menus and right-click, there is no Print Options menu available. Even if I place a Print Command button in the report, this button will not be clickable in Print Preview mode.

How do I add a Print Command button that users will be able to click in Print Preview OR how can I add a menu to show Print Options?
 

June7

AWF VIP
Local time
Today, 15:36
Joined
Mar 9, 2014
Messages
5,423
Reports in Print Preview cannot be interactive. This is why I built custom ribbons and set report RibbonName property.

If you want a custom ribbon or shortcut menu, could not disable for entire application. Ribbons/menus would be set when app opens and when report opens.
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 16:36
Joined
Oct 29, 2018
Messages
21,358
Hi anski. I thought disabling Allow Full Menus still shows the Ribbon with applicable buttons like the Print button on the Report tab, no?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 07:36
Joined
May 7, 2009
Messages
19,169
theDBguy, the Contextual tab for Report in Ribbon will not show if using Overlapping Form and the Report is Pop-up.

to op, you can try adding "Shortcut" menu to your report.
you can inform the user of this feature, on the Report's Caption, eg:

"Sales Report (right-click inside the report to show Options)"

use commandbars to add shortcut(right-click) pop-up menu.

see the sample.
 

Attachments

  • reportRightClick.zip
    37.4 KB · Views: 495

isladogs

MVP / VIP
Local time
Today, 23:36
Joined
Jan 14, 2017
Messages
18,186
@anski
Even if the entire ribbon is normally hidden, it is very easy to display the Print Preview ribbon automatically when a report is opened in preview mode. When the report is closed the ribbon can be hidden again.

For an example showing how this is done, please look at my Control the application interface app.
This includes code to hide the entire application interface if required.
However to see the part relevant to your question, click the Open New Form button on the main screen, then click View Report
 

anski

Registered User.
Local time
Tomorrow, 07:36
Joined
Sep 5, 2009
Messages
93
Hi anski. I thought disabling Allow Full Menus still shows the Ribbon with applicable buttons like the Print button on the Report tab, no?
Hi. See attached picture. This is what it looks like when I disable everything in the Access Options. No menus or toolbars. It does not give the users the chance to "explore" and this is fine with me. The top portion is clean. This is also what it looks like when I open a report in Print Preview mode - no menus or commands are available.
 

Attachments

  • no menus.png
    no menus.png
    16.2 KB · Views: 433

anski

Registered User.
Local time
Tomorrow, 07:36
Joined
Sep 5, 2009
Messages
93
Hi all. I have partially solved my problem. I am able to show the Print Options menu when I open the report in Print Preview mode thus giving the users the ability to adjust the paper size, margins, etc. before printing. I used the following and placed it in On Click of the button to open the report:
DoCmd.ShowToolbar "Ribbon", acToolbarYes (Take a look at the attached picture.)

My problem is the Quick Access Toolbar becomes available. Unfortunately, users can add commands such as Design View to the QAT. What can I do to hide the QAT? I am using Access 2007.
 

Attachments

  • with print options.jpg
    with print options.jpg
    93 KB · Views: 484
Last edited:

isladogs

MVP / VIP
Local time
Today, 23:36
Joined
Jan 14, 2017
Messages
18,186
The QAT is embedded with the ribbon. You either have both or neither. There is no method of treating them separately.
 

anski

Registered User.
Local time
Tomorrow, 07:36
Joined
Sep 5, 2009
Messages
93
to arnelgp: thanks. i could not open your file. the message i get is: unrecognized database format.

i had also thought of enabling in the report the shortcut menus (right-click) but i did not like the idea of the users trying to figure out where the print button was because they could not instantly see one. my last resort would probably be this approach.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 07:36
Joined
May 7, 2009
Messages
19,169
i have a2019 x64, i made another sample in a2010 x32, hope you can open it.
 

Attachments

  • rightClickReport.zip
    32.1 KB · Views: 458

anski

Registered User.
Local time
Tomorrow, 07:36
Joined
Sep 5, 2009
Messages
93
to arnelgp - thanks. i was able to open it.
 

isladogs

MVP / VIP
Local time
Today, 23:36
Joined
Jan 14, 2017
Messages
18,186
You’re welcome. I wish it was possible to manage the QAT separately. I spent a long time unsuccessfully trying to find a way of doing so a couple of years ago
 

isladogs

MVP / VIP
Local time
Today, 23:36
Joined
Jan 14, 2017
Messages
18,186
I've just found this in the similar threads area over a year later.
Just a quick update to say that although you cannot remove the QAT if the ribbon is visible, you can disable the QAT.
Doing this prevents any existing QAT items being run as well as preventing new items being added.
See section 5 of my article Improve Security 2 - Mendip Data Systems
 

Users who are viewing this thread

Top Bottom