Close a report in Preview Mode with disabled menus & disabled right Click

HillTJ

To train a dog, first know more than the dog..
Local time
Today, 04:41
Joined
Apr 1, 2019
Messages
731
Hi,

It's probably simple, but how do I close a report that is in preview mode after I've disabled both the right click menu & the toolbar ribbon?
 
Are you talking about using a keyboard shortcut or an Autokeys macro?
 
@theDBguy , so I use a subroutine that populates :DoCmd.OpenReport [strReportName], acViewPreview, , strWhere. But once I've hidden the toolbar ribbon & disabled the right click option, I cannot figure how to close the form. I'd like the user to be able to click a 'Close" button to close the report. What am I missing? Appreciate the prompt response.
 
add a Shortcut Menu bar to your report.
see the 2 macros in design view.
see the report in design view, see the Shortcut Menu bar (property).
view in print preview and right-click.
 

Attachments

@arnelgp , well that works. I'll give it a go on my report. I remember sometime I read about putting a command button on a report that was not printed along with the body. I couldn't find it, nor am I sure whether this would work in 'preview' mode. But, your solution works. Can i display a 'permanent button? Appreciate it.
 
@theDBguy , so I use a subroutine that populates :DoCmd.OpenReport [strReportName], acViewPreview, , strWhere. But once I've hidden the toolbar ribbon & disabled the right click option, I cannot figure how to close the form. I'd like the user to be able to click a 'Close" button to close the report. What am I missing? Appreciate the prompt response.
Buttons in Preview mode won't work, but they will in Report view. What I've done before, as well, was use a popup form as a floating button to close the report in Preview mode.
 
you need to initially view your report on "report" view if you are going to put a "print button".
Code:
Private Sub printButton_Click()
'set focus to another textbox
Me.ID.SetFocus
Me.printButton.Visible = False
DoCmd.PrintOut
Me.printButton.Visible = True
End Sub
 
Gents, thanks. Will trial the options suggested & let you know. Thanks for the prompt response. I really appreciate it.
 
Alternatively, you can reinstate the ribbon when the report is opened and remove it again when the report is closed.
The attached example shows several ways of handling reports in an application with no ribbon (or in this case, no application window either).
For more info, see Control Application Interface - Mendip Data Systems

EDIT: I have now replaced the zip file as the original caused problems for the OP
 

Attachments

Last edited:
Colin, thanks. But upon unzipping the main menu covers the windows ...accept macros... button & I cannot click to accept! I cannot move the main menu to uncover. Any ideas.
 
Sorry about that.
The usual solution to this type of problem is to open the file using the shift bypass.
Or you could open the file from a trusted location.

However, I've replaced the zip file in post #9 and it should now be OK. Please let me know
 
@isladogs, cheers thanks. By the way, i'm using your login code, which works a treat!..
 
@isladogs , I had a play with your Demo today & can certainly adapt some of your code. Appreciate the effort you have clearly gone to to generate this demo. Will let you know what concept(s) I use. Cheers.
 
You're welcome. I've been gradually adding to that demo app over several years.
I've made quite a few changes recently. Here is the latest version (3.55)
 

Attachments

Users who are viewing this thread

Back
Top Bottom