• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 518
  • Last Modified:

Access report print control

Would you please advice how to add restriction for printing the report file. Any user can preview the report but need password to print out the report. How can I add this criteria in the report print/preview.

Thanks
0
alam747
Asked:
alam747
  • 7
  • 6
  • 6
  • +2
1 Solution
 
mlmccCommented:
I think you would have to disable the system print button and add your own.  You could then ask for a password,

mlmcc
0
 
als315Commented:
You can use On Print event in the report header.
Add your condition (ask for password) and if password is wrong, close report (docmd.close)
0
 
mlmccCommented:
I have an Access database where most forms open with POPUP = YES so the normal menus aren't available.  They can only do what is available on the screen.  I added a print button.

It would be easy to add a password check when the button is clicked or if the users login, check the user id or assign them to classes/groups where only some can print so the button doesn't even appear.

mlmcc
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Jeffrey CoachmanMIS LiasonCommented:
Can you elaborate a bit on this requirement?

The issue with this is that we don't know the level of security needed.
For example, why is printing restricted?

There are dozens of ways a use can bypass most attempts to do this in Access:
Screens capture programs
Generating/exporting/saving the report "As" another format, then simply printing that
Printing the raw data behind the report
Writing down the results when the report is viewed
Printing the report via some external application
...etc

How much do you know about Report design and VBA?


JeffCoachman
0
 
alam747Author Commented:
Would you please write the VB to asking for password in On print event.

Thanks
0
 
mlmccCommented:
Depending on the sophistication of the users it could be as simple a

  If InputBox("Enter Password : ") = "password" then
     Allow print
  Else
     close print attempt

If you need to you could encrypt the password and save it in a table.
Different passwords for each user
That would obviously require writng an encryption routine and a routine to change passwords.

mlmcc
0
 
als315Commented:
I hope you have read Jeff's comment.
Code can be following:
If InputBox("Enter Password : ") <> "password" Then DoCmd.Close
0
 
Jeffrey CoachmanMIS LiasonCommented:
alam747,

So you are not concerned with this being easily bypassed?
see my post:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_26989118.html?cid=1572#a35514912

remember mlmcc also wisely posted:
"Depending on the sophistication of the users..."

Today's users are web, mobile phone, ...etc savvy.
Bypassing something this simple is fairly simple for almost any user...

just my 2c

JeffCoachman
0
 
Helen FeddemaCommented:
But some users are very, very unsophisticated.  Maybe that is the case here.  I recall one who called me up to ask what to do when the screen said "Press Enter to continue" (that was back in dBASE days).
0
 
Helen FeddemaCommented:
I asked her if she had tried pressing Enter, and she said "Oh, I never thought of that!"
0
 
Jeffrey CoachmanMIS LiasonCommented:
<But some users are very, very unsophisticated.>
Yes, my point was only that the "Security" level needed was not clearly stated, nor was the reason for needing this.

My concern was that the next question would be:
    "Users are bypassing my "Security", how do I stop this?"
;-)

For example, at my company we locked down remote Internet Access for years using a simple technique.
Then suddenly, one day, "Everybody" knew how to bypass it (after one user figured it out and told everybody else)

The question of preventing Printing comes up often enough where I always state how easily it can be bypassed.
This is why I asked for the reason behind this.

If it is "crucial" that printing be denied, then something a bit more robust may be needed.
My feeling is that if this is crucial, and it was bypassed, the developer here (The OP) may not know about it until it is too late.
:-(


I find that bypassing certain things is a function of how old the user is.
Most of the "mature" users where I work will try to print using the Print Icon, then try File-->Print, then Ctrl-P,  ...then just give up.

Most of the younger users will immediately use the print screen key and paste to Paint to print out something.

Not even really wanting to "hack" the security, but more like a "Tip" or workaround to get a printout if printing normally does not work
For example:
  "Hey, for some reason, I could not print, so I just did a screen dump"

Or...

User A: "Hey, ...I can't print the Report"
User B: "Dude, just export it to a PDF then print the PDF"

;-)

Jeff
0
 
als315Commented:
<My concern was that the next question would be: "Users are bypassing my "Security", how do I stop this?">
My opinion - access security can start only with some SQL server in background. All other methods are bypassed without problems.
But even with SQL user can use mobile phone for making screenshots and I don't know mehtods for preventing it.
As Helen stated - our users in 99% will not ever try to find alternative solutions and very simple method can be very effective.
0
 
Jeffrey CoachmanMIS LiasonCommented:
I agree, but I still like to let askers know that as long as the output can be "Seen", ..it can be copied (and printed)

;-)
0
 
alam747Author Commented:
I added the following code to report header its asking for password but if I enter wrong password it close the form and preview the report.
Dim strPassword2 As String

strPassword1 = "324576"
If InputBox("Please Enter Password : ") <> strPassword1 Then
    DoCmd.Close
End If

What I am expecting is..
1) while I enter the password it showing every digit entered on the box, would you please tell how can make it invisible like ********* as we normally enter password.
2) while press the print buttom ( a command buttom )in the form it will preview the report but while want to print the form (by rightclick on the previewed report and choose the print menu it will then ask for password, if password is wrong cannot print-out the report or any best suggestion to prevent printout without autorization.
Thanks
0
 
mlmccCommented:
Unfortunately the Input box does not have an option to hide the data entry.

You will need to use a form and a text box. Set the input mask for the text box to be password. This will do what you want.

mlmcc
0
 
alam747Author Commented:
Thanks for your prompt response.
If there any other way to do it , and prevent unauthorized user to print-out the previewed report.

Thanks
0
 
mlmccCommented:
How are users printing?

Have you considered not showing the Access print button and default menus?

Do the users have to log into the application?

mlmcc
0
 
alam747Author Commented:
I already done it, no buttom is dispayed , but if I right click on the print-previewed report a menu comes up and allow me to choose and print the report.

Thanks
0
 
Jeffrey CoachmanMIS LiasonCommented:
Did you read my comments on all the ways that any of these techniques can be *easily* bypassed?

Not trying to stop you from using the suggestions here, ...it's just that you never stated the level of security needed, or the reason behind needing this.
So, based on this lack of information, most experts presumed you needed something "simple/basic"

From the exchange above, you seem to need something more than basic/simple.

Can you first take a step back and *clearly* explain the need for this, and state the level of security required please?

Thanks

JeffCoachman
0
 
Helen FeddemaCommented:
Here's another way:  link to the Access data from Word or Excel, and print it from a Word doc or Excel workbook.  There are so many ways to get data out of Access . . .
0
 
Jeffrey CoachmanMIS LiasonCommented:
;-)
0
 
als315Commented:
<) while I enter the password it showing every digit entered on the box, would you please tell how can make it invisible like ********* as we normally enter password.>
You can create form for password checking. In Form you can use "password" mask.
0
 
alam747Author Commented:
would you please send me simple code for this purpose,
while print button pressed a small pop-up screen(in your concern it will be a form) comes up and ask for password. I am using access 2003.

Thanks
0
 
alam747Author Commented:
Please also want the way that, user can change his password while necessary.
thanks in advance for your help
0
 
mlmccCommented:
You have the basic code.

You need to create a form
Put a text box and label on it to prompt for a password
Put a command button on it to allow the user to suubmit the password
Use the code provided to test the password but check the text in the textbox rather than the input box

Do you have a table built to store user names and passwords?
Do the users log in or will they have to type a user name when they type the password?

mlmcc
0
 
alam747Author Commented:
Thanks for your advice
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 7
  • 6
  • 6
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now