Password encryption

J

janliv1102

I have the following code in my from. This code password protects a control
on the form and prompts the user for a password if you are trying to update
it. The problem I have is that when typing the password if anybody is
standing near they can see what the password is because it is not encypted is
their anything that I can put in this code that will the password encrypted
when I type it in?
Private Sub Credit_Release_Date_GotFocus()
' check for a date. if there, then need pwd.
' Me refers to this form. The '.' dot is like right click and properties.
If Me.Credit_Release_Date.Value Then
If InputBox("To change the credit release date requires an administrator
password. Press Cancel if you don't need to change the date.") = "janel" Then
DoCmd.OpenForm FormName
Else
' they are not authorized to be in this field.
' move them off the field, and tell them.
Me![Comments].SetFocus
MsgBox "You are not authorized! Only administrators can change this
date.", vbOKOnly
End If ' password
End If ' CredRel Date
End Sub
 
J

janliv1102

thanks. But i know that. The problem is that i want the prompt box to be
encrypted. I do not need the control on the form to be encrypted. Does that
make sense?

John said:
From the Access 97 help, after searching for password

Password Setting the InputMask property to the word Password
creates a password entry text box. Any character typed in the text box
is stored as the character but is displayed as an asterisk (*).

I have the following code in my from. This code password protects a control
on the form and prompts the user for a password if you are trying to update
it. The problem I have is that when typing the password if anybody is
standing near they can see what the password is because it is not encypted is
their anything that I can put in this code that will the password encrypted
when I type it in?
Private Sub Credit_Release_Date_GotFocus()
' check for a date. if there, then need pwd.
' Me refers to this form. The '.' dot is like right click and properties.
If Me.Credit_Release_Date.Value Then
If InputBox("To change the credit release date requires an administrator
password. Press Cancel if you don't need to change the date.") = "janel" Then
DoCmd.OpenForm FormName
Else
' they are not authorized to be in this field.
' move them off the field, and tell them.
Me![Comments].SetFocus
MsgBox "You are not authorized! Only administrators can change this
date.", vbOKOnly
End If ' password
End If ' CredRel Date
End Sub
 
D

Douglas J. Steele

As Chris told you, the InputBox doesn't allow any masks.

Create your own form that has a text box with the appropriate mask on it,
and use that form instead of the InputBox.

You'll have to include your own logic to get the value from the form you pop
up into the form that's looking for the password.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


janliv1102 said:
thanks. But i know that. The problem is that i want the prompt box to be
encrypted. I do not need the control on the form to be encrypted. Does
that
make sense?

John said:
From the Access 97 help, after searching for password

Password Setting the InputMask property to the word Password
creates a password entry text box. Any character typed in the text box
is stored as the character but is displayed as an asterisk (*).

I have the following code in my from. This code password protects a
control
on the form and prompts the user for a password if you are trying to
update
it. The problem I have is that when typing the password if anybody is
standing near they can see what the password is because it is not
encypted is
their anything that I can put in this code that will the password
encrypted
when I type it in?
Private Sub Credit_Release_Date_GotFocus()
' check for a date. if there, then need pwd.
' Me refers to this form. The '.' dot is like right click and
properties.
If Me.Credit_Release_Date.Value Then
If InputBox("To change the credit release date requires an
administrator
password. Press Cancel if you don't need to change the date.") =
"janel" Then
DoCmd.OpenForm FormName
Else
' they are not authorized to be in this field.
' move them off the field, and tell them.
Me![Comments].SetFocus
MsgBox "You are not authorized! Only administrators can change
this
date.", vbOKOnly
End If ' password
End If ' CredRel Date
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top