Solved

Password protect a Form

Posted on 2008-06-20
16
2,607 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

749 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