Onclick enter password to unlock form

Blinx

New member
Local time
Today, 09:10
Joined
Apr 17, 2009
Messages
3
Hi there,

I'm using Access 2007.

I've trawled through past forum posts and can't find a solution for this in when searching the net either.

I need to create password security to unlock a form for editing. I want to lock all forums (make them read only) by default but allow people to click a button at the bottom of each form which would prompt for a password and then unlock the form.

I don't need varying user access, there doesn't even need to be a user/pass combo...Simply a quick check "Please enter the password" and the user could type in Passwd...then the code does a quick "if password = passwd...unlock the form".

Could some one please help me with this or direct me to a solution somewhere?

Thanks in advance!
:)
 
Not that this is the safest way (since any user can simply hold Shift while entering the db to unlock), but have you tried something like:

If Me.password_field = "password_string" Then
DoCmd.OpenForm "form to open"
Else
MsgBox "Password incorrect"
End If

Hope this helps.
 
Thanks for your post Honda. That looks like a function to OPEN a form when the correct password is enters.

What I want is for the form to be unlocked for editing. This is really meant to be a deterrent and not proper security. I just want a little more than a lock/unlock button for the form.

Form is locked by default. User clicks button at the bottom right of the screen, box pops up prompting for password, clicking OK unlocks the form.
 
If you use the AllowEdits/AllowDeletes/AllowAdditions properties, just use this for a click event:

Code:
If InputBox("Enter Password", "Enter Password) = "YourPasswordHere" Then
   With Me
      .AllowAdditions = True
      .AllowDeletions = True
      .AllowEdits = True
   End With
End If
 
Honda appears to be offline. You can set edits appropriately:

Me.AllowEdits = True
Me.AllowEdits = False
 
Sorry, I misread the post :-)

You can also use Me.form_field.Locked= true / false, but this applied to individual fields.
 
Thank you everyone. I've got it sorted! I really appreciate your assistance.
 

Users who are viewing this thread

Back
Top Bottom