?
Solved

How to disable printing of a report

Posted on 2002-05-22
24
Medium Priority
?
263 Views
Last Modified: 2008-02-01
Have a report for viewing only, but the users keep on printing it by using Ctrl+P. Is there anyway I can make it a pure view-only report? How?

thanks
0
Comment
Question by:bylj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
  • +7
24 Comments
 
LVL 15

Expert Comment

by:Eric AKA Netminder
ID: 7028881
Not that I know of. Ctrl+P is a Windows function, not an Access function.

You might be able to do a redirect so that the report prints to the screen, but it's beyond my capabilities.

Good luck,

ep
0
 
LVL 1

Expert Comment

by:ravl
ID: 7028945
Even if you could disable CTRL+P there would be nothng stopping the user doing a print screen.
0
 

Expert Comment

by:senan072100
ID: 7029116
OK what about trying when Key press event to redirect the key press to a preview mode not printing mode !!! I dont know I have to test it but this a hint for you guys to try also, correct me if i'm wrong,, cheers
Sinan
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 7029150
or you could maybe use SendKey to pop up a message box stating that the function is not allowed
0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 7029162
sorry i mean AutoKeys.

create a new macro named AutoKeys
make sure View Macro Name is set on
type ^p in Macro Name
set Action = Message Box (or Whatever)


whenever the user hits ctrl+p the message box will load.
0
 

Author Comment

by:bylj
ID: 7029423
Reports dont have a Key_Press_Event.
0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 7029462
you dont need a key press event for my solution
0
 
LVL 9

Expert Comment

by:Volibrawl
ID: 7029664
Just a side observation ..

If your users WANT to print your report so badly, why don't you give them that option?
0
 

Author Comment

by:bylj
ID: 7029864
Datrias:
Your solution would disable Ctrl-P for the whole app. I have certain reports that are printable but couple are NOT to be printed
0
 
LVL 1

Expert Comment

by:aaronkempf
ID: 7029975
there is an event-

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

End Sub

you need to add this:

Cancel = True

THis should do the trick.


0
 

Author Comment

by:bylj
ID: 7032724
tried, it would still print
0
 
LVL 28

Accepted Solution

by:
TextReport earned 200 total points
ID: 7109038
You need to expand a bit on the AutoKeys macro to trap this one and also ensure you remove the print option from the Toolbars and Menubars available to the user.

Create a Macro called AutoKeys and in it include a Macro Name of ^P, Condition of ControlP() and Action of RunCommand with a Run Command or Print. Save the Macro. Now create a new module and paste the follwoing text

Option Compare Database
Option Explicit

Function ControlP()

    If Application.CurrentObjectType = acReport Then
       Select Case Application.CurrentObjectName
           Case "AJTest"
                ControlP = False
           Case Else
                ControlP = True
       End Select
    Else
       ControlP = True
    End If
   
End Function
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7109101
TextReport,

Welcome to Expert's Exchange!

I've rejected your proposed answer for a couple of reasons.

First, by proposing an answer, you move the question from the Open Questions queue to the Locked Questions queue. That makes it much less likely that the Asker will get responses to his question.

Second, you should only propose an answer when you are 100 per cent certain that your response is the ONLY one true answer that will work AND that your response does not duplicate or paraphrase someone else's response.

Again, welcome aboard.

Netminder
CS Moderator
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7226602

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
LVL 15

Expert Comment

by:Eric AKA Netminder
ID: 7227072
Nico,

Isn't "You can't do that" a valid answer?

Best regards,

ep
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7227079
Well, when you "dive" into the API's you should be able to intercept the keystrokes to a window. Not easy, but it should be possible.
Always after making a backup ofcourse, but you should know that ;-)

Nic;o)
0
 
LVL 28

Expert Comment

by:TextReport
ID: 7227374
I still maintain that the answer proposed by me in my first few days on EE is the correct answer, the answer ws not rejected by the person asking the question, this does resolve the question that was originally asked.

EP is incorrect in the statement that you cannnot stop control-p, this is the standard keystroke in windows for teh print dialogue but it is at the control of the application.

Cheers, Andrew
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7227413
I guess it will work, but as bylj wants this to be used selectively, it's not completely suiting his needs...

See:
Comment from bylj
 05/23/2002 08:14AM PST
 
Datrias:
Your solution would disable Ctrl-P for the whole app. I have certain reports that are printable but couple are NOT to be printed
 
Nic;o)
0
 
LVL 28

Expert Comment

by:TextReport
ID: 7227429
Then you include the ones you don't want to print in the case statement along with Case "AJTest".

Cheers, Andrew
0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 7227988
textReport's answer looks good to me
0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 7227990
textReport's answer looks good to me
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7228035
OK, I'll change my recommendation into

 - answered by: TextReport  

Perhaps too much distracted by the answer rejection...

Nic;o)
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7228884
nico,

It happens; the rejection was caused by the request of an Expert (as I recall) who objected to the question being locked. It in no way was intended to reflect on the validity of the comment.

As soon as they give us our tools back, I'll take care of this and the other questions which have had closing recommendations left in them.

Netminder
CS Moderator
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7245563
Per recommendation, force-accepted.

Netminder
CS Moderator
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question