Input mask for password entry within Inputbox
Posted on 2004-10-15
The code below is activated from a command button, the user clicks the button and an Input box appears prompting for a password. However, the password is visible as you type it. How can I add a mask to the input box (asterisk) to conceal the password being entered? Thanks
Private Sub cmdCommOrig_Click()
On Error GoTo Err_cmdCommOrig_Click
Dim strInput As String
Dim strMsg As String
strMsg = "This form is used to input new documents." & vbCrLf & vbLf & "Enter the password for access."
strInput = InputBox(Prompt:=strMsg, Title:="Password")
If strInput = "password" Then ' Password is correct
DoCmd.OpenForm "frmCommOrig", acFormDS, , , acFormEdit
'DoCmd.Close acForm, Me.Name
Else ' Password is incorrect
MsgBox "Password Incorrect!" & vbCrLf & vbLf & "You are not allowed to input new documents.", vbCritical, "Invalid"
MsgBox Err.Number & " " & Err.Description