Inputbox password mask

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Im using this piece of coding to password protect a form, however when the
password is input it is not masked so everyone around can see it, is there
anyway of adding an Input mask to an Input box?

private Sub Form_Open(Cancel As Integer)

Dim Password, Pword
Password = "monkey"
Pword = InputBox("Please Enter Your Password", "Enter Password")
If Pword <> Password Then
MsgBox "Sorry, incorrect password"
End
End If
End Sub
 
bobster said:
Im using this piece of coding to password protect a form, however when the
password is input it is not masked so everyone around can see it, is there
anyway of adding an Input mask to an Input box?

private Sub Form_Open(Cancel As Integer)

Dim Password, Pword
Password = "monkey"
Pword = InputBox("Please Enter Your Password", "Enter Password")
If Pword <> Password Then
MsgBox "Sorry, incorrect password"
End
End If
End Sub

No. You'll have to create a pop-up form that mimics the input box. You
will then be able to set the InputMask property of the password text box to
display asterisks.
 
Back
Top