Solved

Password protect a Form

Posted on 2008-06-20
16
2,603 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

810 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