blank out password characters?

Weresmytriple

Registered User.
Local time
Today, 22:39
Joined
Sep 5, 2013
Messages
58
hi all,

i am currently using

Code:
Private Sub Form_Open(Cancel As Integer)
    Const cstrPassWord As String = "open"
    Dim strPassWord As String
    strPassWord = InputBox("Password:")
    If Not strPassWord = cstrPassWord Then
        Cancel = True
    End If
End Sub

to password protect a form within my database. it is working great however i was wondering if there is any way to make the characters appear as **** when entering the password?

thanks for any help

michael
 
in the InputMask property of the control put "Password" (no quotes)
 
in the InputMask property of the control put "Password" (no quotes)
Looking for that is what we used to call a snipe hunt! The InputBox Function doesn't have an InputMask Property; it's a Function, not a Control!

The only thing you can do is to 'roll your own,' i.e. replace the InputBox with a small Popup Form for entering the password, where you can then set the InputMask for the Textbox to Password, then pass the entered password back to the original Form.

Linq ;0)>
 
hi

thanks for the help guys

im now using a different form with the password imput mask and its working great.

however is there anyway i can make the password case sensitive?

the code i am using is

Code:
Private Sub Submit_Click()
On Error GoTo Err_Submit_Click
If Password = "open" Then
    DoCmd.Close
    
    Dim stDocName As String
    stDocName = "Staff Add Mode"
    DoCmd.RunMacro stDocName
    
    
    Else
    
    MsgBox ("Incorrect Password")
    
    End If
    
Exit_Submit_Click:
    Exit Sub
Err_Submit_Click:
    MsgBox Err.Description
    Resume Exit_Submit_Click
    
End Sub


thanks for any help

Michael
 
Instead of comparing them by means of an Equals operator, use the StrComp method.. Although the StrComp, might result in some undesired result.. So try this..
Code:
If CBool(InStrB(Password, "open")) Then
Some tests..
Code:
? CBool(InStrB("Hello", "Hello"))
True
? CBool(InStrB("hello", "Hello"))
False
? CBool(InStrB("Mom", "Hello"))
False
 
Or, at the top of the code window, for the Form where you're comparing passwords, simply replace

Option Compare Database

with

Option Compare Binary

and comparisons will be Case Sensitive.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom