How to Password Protect a Form or Report in Access
by Shane Zentz
Microsoft makes doing a lot of things with databases very easy. And password protecting a form or report is no exception. With just a few lines of code in the right place you can prevent unwanted users from opening and viewing or editing data in your form or report. Just as an aside, this is not the most secure method and in fact is not really secure at all. But in order for someone to find the password (which is hard-coded into the application) they would have to have at least basic knowledge of access from the design and programming point of view, so if they are just users then chances are that they will never discover the password (by looking at the code behind the program) unless someone tells it to them or they discover it written down somewhere. Having said that, this method is still pretty useful for just average applications, like I said it is not really the most secure method, so if your application contains really sensitive data (like social security numbers or bank account numbers) then I would advise using another more secure method. But if you just need a basic password protection to protect just one or a few forms from average users then this method will work and it is also quick and very easy. So read on to see how this is done.
Open the form or report that you want to password protect in design view and find ‘form’ in the properties field (see photo 1). Then switch to the events tab. Under the events tab you will see a field called ‘on load’ (see photo 1), this is the field that controls what the form or report does when it is first loaded or opened. Here we want to add some code to the on load event so that it will first prompt the user for a password. So click on the tiny icon with the three little dots on it and on the window that pops up, select ‘code builder’. This will bring up a Visual Basic window (see photo 2) which will have a method for the ‘onload’ event preloaded. All we need to do is to add the code to this section.
Here is the code:
Dim PassWord As String
PassWord = InputBox(“Enter Password”)
If PassWord = “whatever password you choose here” Then’
Open FormDoCmd.OpenForm “name of the form that you want to password protect”
ElseMsgBox (“Wrong Password?”)
DoCmd.Close acForm, Me.NameEnd If
Save the code and exit and also save the changes to the form. Now try to open the form and you will get a password box before the form will open. If you enter the correct password then it will open, otherwise it will not. Another thing I should mention is that the text for the password is not dotted out or starred out like is usually is with password protection forms. I think that this can be changed but that is beyond the scope of this tutorial.
This code is pretty basic. To use this you will need to change the line that says “whatever password you choose here” to whatever you want the password to be. And then change the “name of the form that you want to password protect” to the name of your form. Now, you can change “Enter Password” to whatever message you want to appear when the password box comes up, and likewise, you can change the “Wrong Password?” part to whatever message that you want to display when the user enters the wrong password or does not enter any password at all.
So there you have it, a pretty easy and basic password protection system to password protect a form or report in Microsoft access. This will work with just about any version of Access, so give it a try. Just remember that this is not really completely secure becuase anyone who knows how can just look at the form in design view and then check the ‘onload’ event code to discover the hard-coded password, but the average user will never know how to do this anyway, so this is a reasonably decent solution.
Thanks for reading this tutorial on password protecting a form or report in a microsoft access database.
:-DD, http://badcreditloans15m.co.uk bad credit loans loans for bad credit cejcdy9sj0of, usa auto insurance http://autoinsuranceratescheapest.com/ car insurance cheap auto insurance SubstanceAbuseCounselorHQ.com http://www.SubstanceAbuseCounselorHQ.com http://www.SubstanceAbuseCounselorHQ.com http://www.SubstanceAbuseCounselorHQ.com.
ke3xp00efyn0, >:-]], http://paydayloansonlinebro.com/ paydayloansonlinebro.com >:-OOO, http://ukgreencoffee1.tumblr.com/ http://ukgreencoffee1.tumblr.com/ loans pay day http://badcreditloansuk.webs.com/ money pay day loans
Great article. I will be dealing with a few of these issues as well.
.
This information is priceless. When can I find out more?
Write more, thats all I have to say. Literally, it seems as
though you relied on the video to make your point. You definitely know what youre talking about, why waste your intelligence on just posting
videos to your weblog when you could be giving us something informative to
read?
Do you have a spam problem on this website; I also am a blogger,
and I was curious about your situation; we have developed some nice methods and we are looking to swap strategies with other folks, please shoot me an e-mail if interested.
Hmm is anyone else experiencing problems with the images on this blog loading?
I’m trying to figure out if its a problem on my end or if it’s the blog.
Any responses would be greatly appreciated.
http://badcreditloansengland.co.uk installment loans uk 9ovr7xmj1, >:-]], loans 4 u best pay day loans short loan a1qiclkhrp, http://samedayloansco.co.uk money same day.
greencoffeeuk1.webs.com http://greencoffeeuk1.webs.com/ read this bamnmyviqefn8dy, greencoffeebean101.moonfruit.com green coffee australia check my blog green coffee extract use http://ukgreencoffee1.tumblr.com/ More hints Look At This.
Greetings! I know this is kinda off topic but I was wondering which blog platform are you using for this
website? I’m getting fed up of WordPress because I’ve had problems with hackers and I’m looking at alternatives for another platform. I would be fantastic if you could point me in the direction of a good platform.
What’s up, after reading this amazing post i am as well happy to share my knowledge here with colleagues.
This is a good tip especially to those new to the blogosphere.
Brief but very precise information… Many thanks for sharing this one.
A must read post!
There’s certainly a lot to find out about this subject. I really like all the points you have made.
dqebajrtvnz2w, quick loan bad credit same day http://badcreditloansa.co.uk quick cash loans 100 payday loan personal loans ewokqz17gn, >:-]], http://www.drupal.org.uk/user/bad-credit-loans borrow money
I have read so many posts about the blogger lovers but this post is actually a fastidious piece of writing, keep it up.
Great information. Lucky me I discovered your website by chance (stumbleupon).
I have saved as a favorite for later!
>:[[, http://samedayloansagent.co.uk payday lenders uk cheap pay day loans bad credit same day loans pay day loans lenders jr7sns6gq, quick payday loan same day loans jjylodvcofn, >:-OOO, loans short term.
dpyv1z8krzij5, >:-]], http://a12monthloans.co.uk pay 12 month loans %(((, payday loans no credit check same day http://badcreditloansbritian.co.uk payday loan direct lenders uk same day loan unemployed personal loan
I leave a comment each time I especially enjoy a post on a website or I have something to valuable
to contribute to the discussion. It is a result of the sincerness communicated in the post I read.
And on this post How to Password Protect a Form or Report
in Microsoft Access | Shane Zentz’s Blog. I was actually excited enough to post a thought 😉 I do have a couple of questions for you if it’s
allright. Could it be only me or do some of these responses appear
like they are coming from brain dead visitors?
😛 And, if you are posting at additional places, I’d like to keep up with everything fresh you have to post. Would you list all of all your community pages like your linkedin profile, Facebook page or twitter feed?
I do trust all of the ideas you’ve presented to your post. They are really convincing and will definitely work. Nonetheless, the posts are very quick for novices. May you please lengthen them a little from subsequent time? Thanks for the post.
>:[[, money lending payday loans guaranteed http://greencoffeeuk1.webs.com/ http://greencoffeeuk1.webs.com/ 5e7oa0ojm4jcq, %(((, paperless payday 12 month loans money lenders pay day 12 month loans uk bad credit
Hi, always i used to check blog posts here early in the morning, because i love to gain knowledge of more and more.
Thank you for every other informative blog. Where else may just I get that kind of information written in such an ideal manner?
I have a challenge that I am simply now running on, and I’ve been at the glance out for such information.
It’s impressive that you are getting ideas from this article as well as from our dialogue made here.
Hello There. I found your weblog the usage of msn.
That is a very smartly written article. I will be sure to bookmark
it and come back to read extra of your helpful info. Thanks for the post.
I will certainly comeback.
Hey! I know this is kinda off topic but I’d figured I’d ask.
Would you be interested in exchanging links or maybe guest authoring a blog post or vice-versa?
My blog covers a lot of the same subjects as yours and I think
we could greatly benefit from each other.
If you are interested feel free to shoot me an e-mail.
I look forward to hearing from you! Terrific blog by the way!
May I simply just say what a comfort to find a person that actually
understands what they’re discussing on the web. You definitely understand how to bring a problem to light and make it important. More and more people should check this out and understand this side of your story. It’s surprising you aren’t more popular given that you definitely possess the gift.
At this time I am going to do my breakfast, after having my breakfast coming yet
again to read further news.
vvaabh, http://fastpaydaycashloans1.co.uk compare 12 month loans >:-OOO, http://greencoffeeuk.weebly.com/ green coffee reviews :-DD, no credit check loan http://12monthloansx.co.uk pay day 12 month loans for bad credit same day pay day 12 month loans for bad credit
I think the admin of this web site is truly working hard for
his web site, because here every information is quality based material.
It is perfect time to make some plans for the future and it is time to be happy.
I’ve read this post and if I could I desire to suggest you some interesting things or advice. Perhaps you can write next articles referring to this article. I wish to read even more things about it!
May I simply just say what a comfort to uncover someone who actually understands what they are talking about over the internet.
You definitely know how to bring a problem to light and make it important.
More and more people really need to look at this and understand this side of your story.
I can’t believe you are not more popular because you most certainly possess the gift.
Pretty! This has been a really wonderful article. Thank you for providing
this info.
Wonderful site. Lots of helpful information here.
I’m sending it to some pals ans also sharing in delicious. And of course, thanks in your effort!
Thank you, I’ve recently been looking for information approximately this topic for a while and yours is the greatest I’ve
came upon so far. But, what concerning the conclusion?
Are you sure in regards to the supply?
Keep on writing, great job!
Hey! Someone in my Myspace group shared this site with
us so I came to give it a look. I’m definitely loving the information. I’m book-marking and will be tweeting this to
my followers! Wonderful blog and outstanding style and design.
Simply wish to say your article is as astounding.
The clearness in your post is simply excellent and i can assume you’re an expert on this subject. Well with your permission allow me to grab your feed to keep up to date with forthcoming post. Thanks a million and please continue the rewarding work.
Link exchange is nothing else however it is just
placing the other person’s webpage link on your page at appropriate place and other person will also do same in support of you.
Simply wish to say your article is as astonishing. The clarity in your post is just excellent and i can assume you are an expert on this subject.
Fine with your permission let me to grab your RSS feed to keep up to date with forthcoming post.
Thanks a million and please continue the rewarding work.
I know this if off topic but I’m looking into starting my own blog and was wondering what all is needed to get set up? I’m assuming having
a blog like yours would cost a pretty penny? I’m not very internet savvy so I’m not 100% positive. Any recommendations or advice would be greatly appreciated. Many thanks
If you are going for most excellent contents like myself, only pay a quick visit this web site
everyday since it presents feature contents, thanks
I delight in, result in I discovered exactly what I used to
be looking for. You have ended my four day long hunt!
God Bless you man. Have a nice day. Bye
It is the best time to make some plans for the future and it is
time to be happy. I have read this post and if I could I desire
to suggest you few interesting things or tips.
Perhaps you could write next articles referring to this article.
I want to read more things about it!
Its like you read my mind! You appear to know so much about this, like you wrote the book in
it or something. I think that you can do with some pics to drive the message home a bit, but other than
that, this is wonderful blog. A great read. I will definitely be back.
Hi there! I could have sworn I’ve been to this blog before but after looking at many of the posts I realized it’s new to me.
Anyways, I’m certainly pleased I discovered it and I’ll be book-marking
it and checking back regularly!
Hi there, the whole thing is going nicely here and ofcourse every one is sharing facts,
that’s truly good, keep up writing.
Hello would you mind letting me know which web host you’re using? I’ve
loaded your blog in 3 different internet browsers
and I must say this blog loads a lot quicker then most.
Can you recommend a good hosting provider at a honest price?
Thanks a lot, I appreciate it!
kcp7kktlpzmnj8ku, greencoffeereport.co.uk greencoffeereport.co.uk http://www.howtomakefastmoney.info http://www.howtomakefastmoney.info best pay day loan company cash loans today
I was wondering if you ever considered changing the layout of your blog?
Its very well written; I love what youve got to say.
But maybe you could a little more in the way of content so people could connect with it better.
Youve got an awful lot of text for only having
1 or two pictures. Maybe you could space it out better?