Password format for Input box (1 Viewer)

JohnLee

Registered User.
Local time
Today, 00:22
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
 

rainman89

I cant find the any key..
Local time
Today, 03:22
Joined
Feb 12, 2007
Messages
3,015
put the password input mask on the txtpasswordbox.


Access will convert it automatically
 

JohnLee

Registered User.
Local time
Today, 00:22
Joined
Mar 8, 2007
Messages
692
put the password input mask on the txtpasswordbox.


Access will convert it automatically

Hi I'm not using a text box, what I am using is the event procedure for the command button that opens the specific form, otherwise I would have done as you suggested. I need to do this when the password is entered into the input box, hence the "inputbox" function in the code shown.

but thanks for your response anyway.

John
 

Guus2005

AWF VIP
Local time
Today, 09:22
Joined
Jun 26, 2007
Messages
2,642
Create your own inputbox: frmInputBox
and use the following function to open it:
Code:
Public Function OpenAndWaitForForm(strFormname As String, Optional blnOpen As Boolean = False)

    Dim blnFormOpen As Boolean
    
    If blnOpen Then
        DoCmd.OpenForm strFormname
    End If

    blnFormOpen = True
    Do While blnFormOpen
        blnFormOpen = False
        If IsLoaded(strFormname) Then blnFormOpen = True
        DoEvents
    Loop

End Function
HTH
 

JohnLee

Registered User.
Local time
Today, 00:22
Joined
Mar 8, 2007
Messages
692
Hi Thanks for your response,

Perhaps I haven't written clearly what it is I am trying to achieve, But I do not want to create another form with the password feature, that has to be activated in order to open up another form, I have already done this previously and it is not particularly efficient.

What I want to do is, is to be able to force the inputbox function to display an astrix for each character that is entered into it, hence the code in my initial thread.

If it is not possible that's fine, I will have to review my method in respect of this aspect of my project.

Once again thanks for your response.
 

Guus2005

AWF VIP
Local time
Today, 09:22
Joined
Jun 26, 2007
Messages
2,642
What I want to do is, is to be able to force the inputbox function to display an astrix for each character that is entered into it, hence the code in my initial thread.
you can't. that's why i offered you a workaround.

HTH

(You can! But only if the password consists of only asterisks)
 
Last edited:

DJkarl

Registered User.
Local time
Today, 02:22
Joined
Mar 16, 2007
Messages
1,028
Hi Thanks for your response,

Perhaps I haven't written clearly what it is I am trying to achieve, But I do not want to create another form with the password feature, that has to be activated in order to open up another form, I have already done this previously and it is not particularly efficient.

What I want to do is, is to be able to force the inputbox function to display an astrix for each character that is entered into it, hence the code in my initial thread.

If it is not possible that's fine, I will have to review my method in respect of this aspect of my project.

Once again thanks for your response.

It cannot be done using the functionality found in Access, it requires you to use APIs, check out the link below for an example.

http://www.tek-tips.com/faqs.cfm?fid=4617
 

Users who are viewing this thread

Top Bottom