Disable Print

doco

Power User
Local time
Today, 13:02
Joined
Feb 14, 2007
Messages
482
Many of the reports I generate are FYI or to be used to review and compare data. The problem is some staff insists on printing each and every one of these reports, some of which are a couple hundred pages, instead of reviewing them on the monitor. There is no need for this waste of paper.

I would like to disable the ability to print these reports yet keep Print Review.

TIA
 
It may not suit what you want to do, but I have all reports in my application run the following code when they open and close, to call a function
Code:
Private Sub Report_Close()
    Dim str_Enable As String
 
    str_Enable = "False"
    Call Report_Controls(str_Enable)
End Sub
 
Private Sub Report_Open(Cancel As Integer)
    Dim str_Enable As String
 
    str_Enable = "True"
    Call Report_Controls(str_Enable)
 
End Sub
This function displays (on open) or hides (on close) a custom menu, ensuring that only certain menu buttons are available.
In my case, these are Print, Send, Zoom and Close.
It would be easy to remove Print and Send from these options.
 
Reports have an On Print Event. You can set the Cancel variable to true to cancel the print job.
 
Reports have an On Print Event. You can set the Cancel variable to true to cancel the print job.

I see that. So, just a simple

Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
 
    Cancel = 1    '   True, or any non zero integer?
 
End Sub
 
NOpe - that produces a blank report.
 
It may not suit what you want to do, but I have all reports in my application run the following code when they open and close, to call a function
Code:
Private Sub Report_Close()
    Dim str_Enable As String
 
    str_Enable = "False"
    Call Report_Controls(str_Enable)
End Sub
 
Private Sub Report_Open(Cancel As Integer)
    Dim str_Enable As String
 
    str_Enable = "True"
    Call Report_Controls(str_Enable)
 
End Sub
This function displays (on open) or hides (on close) a custom menu, ensuring that only certain menu buttons are available.
In my case, these are Print, Send, Zoom and Close.
It would be easy to remove Print and Send from these options.

So your Report_Controls function loops through all the command bars and disables the menu tool bar?
 
So your Report_Controls function loops through all the command bars and disables the menu tool bar?
Yes.

I got sick of certain users using the 'X' to close the application (as there's code I want to run whe people log out), so I deactivated that and the main Access menu bar.

I now have two custom menus. One is available at all times other than when a report is open, the other is only available when a report is open.

It works for what I need.
 
Access has the ability to have a report print on a specific printer for a specific user. Doesn't this option also allow a user not to print at all?
 
Looks like a custom tool/menu is in order...
Thanks
 

Users who are viewing this thread

Back
Top Bottom