Password protect Access Report/Form

si_pooh

New Member
Joined
Sep 23, 2004
Messages
23
Anyone knows how to password protect a form/report in Access. I have a form setup so that when a user click on the button it will open an access report. However I'd like to prompt a password so that not everyone can run the report. Help??
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Something like this works but it's clunky. It requires you lock down your db so the user can't see the code, or open the report in some other fashion. There are probably more professional possibilities out there like getting the user's windows login and checking vs some user list/groups etc.

Code:
If "ThePassword"=InputBox$("Enter Password", "Limited Access") Then
  DoCmd.OpenReport "MyReport"
Else
  MsgBox "You're not allowed to see this."
End If

hth,

Rich
 
Upvote 0
Glad I came across this post. I think I can expound on the solution as I am looking for some help in the area. You can create a table of users and passwords with the passwords being MD5 hashed. This way, instead of checking a harcoded constant within the programming, you can check against an encrypted variable that if a user were to try to find would still be unable to break it easily.

If you are looking for something way more secure, than this is probably not it, but this does deal with not allowing everyday average users to see reports that they need not be seeing.

So the question is, what is the next step? I have created tblUsers with fields userName and pWord. I am only sure in theory how to check the user and password and not sure what it looks like in code. Also, can the tblUsers itself be protected against editing? I wouldn't want someone to get in there and delete the hashed password, thus making the report inaccessible to everyone.
 
Upvote 0

Forum statistics

Threads
1,224,514
Messages
6,179,220
Members
452,895
Latest member
BILLING GUY

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top