Solved

Password protect a Form

Posted on 2008-06-20
16
2,599 Views
Last Modified: 2010-05-18
I've found a few questions where this has been discussed but the solutions are a little more intense than what I'm looking for. I've got a form in an Access 2003 .mdb that I want to password protect. This form allows data to be edited in a table that I want to remain off limits. I don't want to use user permissions, etc - B/c they are a nightmare to understand and implement and a high level security is not a main focus. I'm not worried about someone stealing the data, I'm worried about someone that doesn't know what they're doing pressing buttons.

What I want is this:

User clicks a button, prompt/msgbox is displayed that asks for a password, user enters password, form is opened. Incorrect or no password entered = form doesn't open, msgbox displays "incorrect password".

I'm not really looking for anything over-the-top with user names, etc.

Help is appreciated!! Thanks!!
0
Comment
Question by:Haze0830
  • 8
  • 5
  • 2
  • +1
16 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 400 total points
ID: 21834066
look here

How to Create a Password Protected Form or Report
http://support.microsoft.com/?kbid=209871
0
 
LVL 75
ID: 21834078
Private Sub Form_Open(Cancel As Integer)

  IF InputBox ("Enter Password") <> = "YourHardCodedPassword" Then
       Msgbox "Sorry, get lost dude"
       Cancel = True
  End If

End Sub

   
0
 
LVL 2

Author Comment

by:Haze0830
ID: 21855811
capricorn -

Tried that one. Can't get it to work for some reason.
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 21855884
post the codes you are using, so we can find the reason why it is not working

or better attach the db with the form. check Attach File below
0
 
LVL 2

Author Comment

by:Haze0830
ID: 21856322
DataBase -

I get a syntax error on the IF line.
0
 
LVL 2

Author Comment

by:Haze0830
ID: 21856355
Capricorn -

I'm using the exact codes it's giving, just modifying DB object names where applicable.
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 21856366
what IF line? where is the IF line?
0
 
LVL 2

Author Comment

by:Haze0830
ID: 21856404
From his original post:

" IF InputBox ("Enter Password") <> = "YourHardCodedPassword" Then "
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 119

Expert Comment

by:Rey Obrero
ID: 21856411
Haze0830,

post the codes here and indicate where you are getting the error. and what is the error you are getting.
0
 
LVL 2

Author Comment

by:Haze0830
ID: 21856435
will do
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 21856450
i did not post this
<IF InputBox ("Enter Password") <> = "YourHardCodedPassword" Then>

the correct syntax is

IF InputBox ("Enter Password") <>  "YourHardCodedPassword" Then

0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 100 total points
ID: 21856883
Sorry about the TYPO

 <> =

s/b

<>

no equals sign ...

mx
0
 
LVL 2

Author Comment

by:Haze0830
ID: 21856939
ok, i found the problem. It didn't like me leaving using a linked table for the password table. As soon as I changed that it worked fine.
0
 
LVL 2

Author Comment

by:Haze0830
ID: 21856949
I know you didn't capricorn. That's my post was directed at Database.
0
 
LVL 2

Author Comment

by:Haze0830
ID: 21859388
Both work. But I'm going to go with Capricorn's. I'll split the points in his favor. Thanks for the help.
0
 

Expert Comment

by:whitesandsbeach
ID: 22970944
I don't see how the password "PASSWORD" creates security. Anybody might use it. Please explain.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now