Password protect a Form

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!!
LVL 2
Haze0830Asked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
look here

How to Create a Password Protected Form or Report
http://support.microsoft.com/?kbid=209871
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
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
 
Haze0830Author Commented:
capricorn -

Tried that one. Can't get it to work for some reason.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Rey Obrero (Capricorn1)Commented:
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
 
Haze0830Author Commented:
DataBase -

I get a syntax error on the IF line.
0
 
Haze0830Author Commented:
Capricorn -

I'm using the exact codes it's giving, just modifying DB object names where applicable.
0
 
Rey Obrero (Capricorn1)Commented:
what IF line? where is the IF line?
0
 
Haze0830Author Commented:
From his original post:

" IF InputBox ("Enter Password") <> = "YourHardCodedPassword" Then "
0
 
Rey Obrero (Capricorn1)Commented:
Haze0830,

post the codes here and indicate where you are getting the error. and what is the error you are getting.
0
 
Haze0830Author Commented:
will do
0
 
Rey Obrero (Capricorn1)Commented:
i did not post this
<IF InputBox ("Enter Password") <> = "YourHardCodedPassword" Then>

the correct syntax is

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

0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Connect With a Mentor Commented:
Sorry about the TYPO

 <> =

s/b

<>

no equals sign ...

mx
0
 
Haze0830Author Commented:
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
 
Haze0830Author Commented:
I know you didn't capricorn. That's my post was directed at Database.
0
 
Haze0830Author Commented:
Both work. But I'm going to go with Capricorn's. I'll split the points in his favor. Thanks for the help.
0
 
whitesandsbeachCommented:
I don't see how the password "PASSWORD" creates security. Anybody might use it. Please explain.
0
All Courses

From novice to tech pro — start learning today.