password in a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to have a button on a form to open another form. The form to be
opened I would like to open after a password has peen entered. Can you help
please?

thanks, Edward Keith
 
I would like to have a button on a
form to open another form. The form
to be opened I would like to open after
a password has peen entered.

Before answering a "security lite" question, I always feel obligated to say
that any self-implemented security scheme can be broken, and it doesn't take
a "real hacker" to do so -- that is, most are very easily broken into.

Put a TextBox on your Form, set its Format property to "Password" so that
whatever is typed will be displayed as a string of *s. You can use the
Wizard to create the code to Open the target form, and surround the
DoCmd.OpenForm with your code to check the password. I would guess the best
way would be to have a table stored with the user's id and password, and
look up by user name (which entails, also, applying Access' security -- and,
since you are doing that, perhaps you would be better to check that the user
is in the group that has permission to open the other form instead of coding
your own).

Larry Linson
Microsoft Access MVP
 
Bruce,


Create a small form frmPassword with the following
a text box txtPassword
two buttons cmdOK & cmdCancel
'passwordstring' will be the password for you to open the other form

cmdCancel:
cmdCancel will close the password form
txtPassword:
this textbox control will be unbound
OPTIONAL: with a validation rule "Is Not Null" (Error message : Password
cannot be empty)
cmdOK:
will validate password and open your other form using the following code
Private Sub cmdOK_Click()
If txtpassword.Value = "passwordstring" Then
' open your custom form from here
DoCmd.Close acForm, "frmPassword"
Else
MsgBox "Check the password you have entered"
Me.Undo 'or txtpassword = "" to cancel wrong password OPTIONAL
txtpassword.SetFocus
End If
End Sub


Use your button to open the above form and if the password was valid the
other form will be opened

it is preferable that the frmPassword is set to be popup and modal from the
Form Properties.


Regards

Rajesh V R
rajeshontheweb at indiatimes dot com
 
Thanks, but I am familiar with the general procedure. I was curious as to
what new information might be at the link provided in the message to which I
replied, but when I clicked on the link I received a "Page Not Found"
message. I was just pointing out that the link is dead.
 
Back
Top