Solved

Password protect a Form

Posted on 2008-06-20
16
2,611 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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 - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

691 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