Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

password font

Status
Not open for further replies.

dmb1

Technical User
Sep 19, 2000
55
GB
On my form I have a button which requires a password before it displays another form. The problem is that when the user inputs the password it is clearly visible to everyone around them. Is there a way to encript the writing when putting in the password or a way to put the font to a symbol font?

The code I am using is:

strMsg = "To see this report requires a password. Please enter a valid password below.!
strInput = "InputBox(Prompt = strMsg, title:="User Info", XPos:=2000. YPos:=2000)
If strInput = "Password" then GoTo Correct
GoTo Incorrect

Correct:
MsgBox "Password correct", vbExclamation, "Valid"
Me!form.visile = true

GoTo Exit_sub

Incorrect:
MsgBox "Invalid Password entered."

Exit_sub:
end Sub

Any help will be great

dmb1
 
Change the field's input mask to be Password. Then it will put asterisks where password would be.

No special coding needed!

HTH

Mary :eek:)
 
There is no field involved. The code is located on a command button which the user presses.

Is there another way

dmb1
 
InputBox doesn't support masking. You could add a text box to the form and set it's Input Mask property to Password.

Dave
 
In the past, I've always created a new form for just the purpose of Password Authentication.

I usually create a seperate table that has usernames and passwords (yeah, I know I could be useing Access's way of handling Users and Groups, but I don't like it). Just make sure that your users have no way of accessing that table (which I'm assuming you're doing already, since you need them to get through the authentication process just to see the data). Even so- the field for the passwords would be "*"'d out anyhow, if you've set the Format property to be 'Password'.

The best way to do this, if you want to require users to enter a password in different occasions, just create 1 generic form for authentication, and open the form with the OpenArgs being the name of the report that is to be opened if the password's correct.

IE...
Call the form with something like this:
Private Sub btnOpenReport_OnClick()
DoCmd.OpenForm "PasswordAuthenticate", , , , , acDialog, "SecureReport"
End Sub

Hmmm... Kinda confusing explaining this I guess. [8O)

PasswordAuthenticate, is the name of the form that has Password and User (or just Password) fields to enter.
SecureReport is the name of the form or report that gets opened, BY the PasswordAuthenticate form, IF they've typed in the correct information.

Therefore, you'd also have to have a button or something, on the PasswordAuthenticate form, in order to run the code to open the form they want... ie.

Private Sub btnOpenIt()
If ... then ' enter code to check if it's the correct information
DoCmd.OpenForm OpenArgs
Else
MsgBox "Sorry, You loose. Not this time pal!"
DoCmd.Close acForm, Me.Name
End If
End Sub

These forms can get hairy sometimes, but they do make the application look more professional if you set them up well. Frankly, I have ALL my databases that are being put into production, use a password authentication form for the StartUp form.

Hope that helps some...

Good Luck, and Keep Coding - MoGryph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top