Password format for Input box

JohnLee

Registered User.
Local time
Today, 13:09
Joined
Mar 8, 2007
Messages
692
Good afternoon,

I am trying to create a process whereby the user has to enter a user ID and the a password, but I want the password aspect to be displayed as astrix's as they enter in their password and not the actual characters that is being entered.

I am having trouble working out how to convert the password aspect characters to astrix's, what I have done is shown below, any assistance would be much appreciated.

BEGIN CODE

On Error GoTo Err_cmdOpenEmployeeDetailsForm_Click

Dim stDocName As String
Dim stLinkCriteria As String
Dim strUserID As String
Dim strPassword As String
Dim strPrompt1
Dim strPrompt2
Dim strTitle1
Dim strTitle2

strPrompt1 = "Enter Your User ID"
strTitle1 = "User ID"
strUserID = InputBox(strPrompt1, strTitle1)
strPrompt2 = "Enter Your Password"
strTitle2 = "Password"
strPassword = InputBox(strPrompt2, strTitle2)

If strUserID = "leej" Then
If strPassword = "24497195" Then

stDocName = "frmEmployees"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "Your are not Authorised to access this"
End If
End If

Exit_cmdOpenEmployeeDetailsForm_Click:
Exit Sub

Err_cmdOpenEmployeeDetailsForm_Click:
MsgBox Err.Description
Resume Exit_cmdOpenEmployeeDetailsForm_Click

END CODE
 
Completely without vba:

Go to the table, where the user password is stored in design view.
Select the field with the password, click on Entry format (hope that's what it shows in English Access) and then on the "...", you can actually select "Password", which does exactly what you want. Does it?
 
You want an unbound TextBox on a custom form with the InputMask property of the TextBox set to PASSWORD. InputMasks cannot be applied using InputBox, and you don't want your login process to expose the actual password in a bound textbox for obvious reasons. You want to compare the password supplied by the user with the one in the table.
 
I have done this, but by looking at your code i can't tell if you really have a User-Password Table. I think it would be better if you create a table (tblUser) with a User (fldUser) Field and Password (fldPassword) using the format that fbsrcchaos says.
Then Adding to lagbolt in the custom form u should have 2 text boxes (txtUser), (txtPassword) and a Login button (cmdLogIn)
Theres a function, DLookUp() that you may use.
So on cmdLogIn click event you may put something like this.

Sub cmdLogIn_Click

If txtPassword = DLookUp("fldPassword", "tblUser", "fldUser = " & txtUser) Then
'Log In and do whatever
Else
Msgbox "User and Password do not match"
End if

End Sub
 

Users who are viewing this thread

Back
Top Bottom